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

How to propel an object in a direction based on its orientation?

I have an airplane that I want to move in the direction that it's facing, so that the pilot can steer instead of merely watch as the thing careens along the X axis. Does anybody know of any service, entity, or scripting technique I could use to achieve this? Vectorforce isn't working for me.

1 answer

Update the part's CFrame using RunService or some other method and move it forwards relative to the part's orientation. -5 is forwards 5 studs on the Z-plane. Adjust this value to your liking.

local part = plane

game:GetService("RunService").Heartbeat:Connect(function()
	part.CFrame = part.CFrame * CFrame.new(0, 0, -5) 
end)

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