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

How to get the axis of a part's surface?

I'm trying to make a controllable underwater vehicle, and when the character turns, I want to be able to get what direction they are moving, so the vehicle isn't glitchy while moving. Any help is appreciated!

~Marco

1 answer

i had this very same problem yesterday. im not sure what you are using for your force of movement, but i used body velocity. LookVector is the front axis of the part. you can read up on this on the wiki you can also use RightVector and UpVector. this is just a small snippet of my script:

local force = script.Parent.BodyVelocity
force.Velocity = seat.CFrame.lookVector * 100

change force.Velocity to whatever force you are using to move your boat, whether it be bodyfocre, or something..

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