Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can anyone help me with this formula or script? Answers are appriciated

Asked by 6 years ago

Im trying to make a spaceship everything works good besides the fact that the speed slows down if i push the nose of my spaceship up or down. I Think it has to do with the formula im using to determine the velocity of the bodyvelocity, this is the script:

local Ship = script.Parent
local primary = Ship:WaitForChild("Primary")
local seat = Ship:WaitForChild("VehicleSeat")
local BV = primary:WaitForChild("BodyVelocity")
local Speed = Ship:WaitForChild("CurrentSpeed")
local LookPart = Ship:WaitForChild("LookPart")

local Hoover = Ship:WaitForChild("Hoover")
Hoover.Value = true

local BP = primary:WaitForChild("BodyPosition")

while wait() do


    BV.Velocity = LookPart.CFrame.lookVector * Speed.Value  



    if Hoover.Value == false and Speed.Value >= 1 then

        BP.Position = seat.Position

    end


end

1 answer

Log in to vote
0
Answered by 6 years ago

Don't want to crush your dreams here but, try a different approach, using body position to move a ship is horrible, make a local script to control your character, because the Vehicle is attached to the player and thus the client can control the vehicle at 60 frames per second.

0
Wait you mean like making the player control the ship instead of the character? 1000anton 38 — 6y
Ad

Answer this question