I am trying to build a roller coaster, but I want the velocity to go in the direction of the track. I have tested it, but I do not go in the right direction. I am using lookVector, but that may not be it. Here is the script.
wait(1) script.Parent.Velocity = Vector3.new(0,0,0) print(script.Parent.CFrame.lookVector) script.Parent.RotVelocity = script.Parent.CFrame.lookVector*script.Parent.Parent.LSPeed.Value
Thank you, and have a nice day.
The RotVelocity does not help with movement aside from rotation, and lookVector doesn't give you the type of angle you'd want. Try applying the lookVector to Velocity.
Edit: lookVector returns a Unit-Vector rather than a regular Vector3, a Unit-Vector uses direction values between -1 and 1 to signify the direction, for instance, if I were to have a Unit-Vector of (-1,0,0), the direction would be directly to the right of me, (0,1,0) would be upwards. To get a good velocity, you'd need to multiply the unit vector by a set value.
lookVector returns a Grid like this
[1][0][0] [0][1][0] [0][0][1] --Standard brick Orientation
[1][0][0] [0][-1][0] [0][0][1] --Upside-down brick Orientation
it only returns values from -1 to 1 including decimals. This is a fairly decent article on C-Frame and Matrices http://wiki.roblox.com/index.php?title=User:MrNicNac/CFrame_Cheat_Sheet