I'm attempting to make a flight simulator, and everything is working well so far, except for the BodyVelocity which makes the plane move forward. I've checked my script over numerous times, and looked on this site, but couldn't find the problem. And yes, the force is a high amount.

Here is the script, I'd be glad if I could get some help with this.

local velocityval = script.Parent.BodyVelocity.Velocity
local throttleval = script.Parent.Throttle.Value
local desiredSpeed = Vector3.new(0)
local main = script.Parent
local currentSpeed = Vector3.new(0)

while true do
	desiredSpeed = Vector3.new(throttleval)
	 for i = 0, 1, .01 do
	currentSpeed = currentSpeed currentSpeed:lerp(desiredSpeed,i)
	wait()
	velocityval = (main.CFrame.lookVector*currentSpeed)	
	main.Lift.Force = Vector3.new(0, main.Velocity.Magnitude * 50000, 0)
	end
	wait()
end

(I know, it's messy. :P)

2 comments

0

You didn't mention what was/wasn't happening. If nothing's moving, I've sometimes had trouble where the model I'm trying to move has had a joint connection to the base. Could that be it? (To test it out, manually move the plane into the air a few studs while the velocity is active and see if it works.)

0

That's not the problem, when the game starts, the plane falls from about 10 studs up onto the baseplate to ensure no welds are created. Without lerp, the plane moves just fine.