Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

1 comment

0

Wait you mean like making the player control the ship instead of the character?

This discussion is preserved as it was. New answers, comments, and votes are closed.