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

Rollercoaster track velocity?

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.

2 answers

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.

2 comments

0

Please elaborate what you mean by, "Try applying the lookVector to Velocity." Becasue if you are saying instead of doing RotVelocity, just do Velocity, that was the first thing i tried, and it did the same thing.

0

So basically the new script would be just without RotVelocity?

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