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

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

Asked by
znepb 17
6 years ago

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

Log in to vote
0
Answered by
wookey12 174
6 years ago
Edited 6 years ago

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..

Ad

Answer this question