- Home /
Roller Coaster force
I have a question. I made a game that resembles a roller coaster. The track diagram shown here is made of a twisted modeled tube and I placed a sphere game object inside the tube which will represent the coaster. I have gravity turned off. I created a script and assigned it to the sphere,which also have a rigid body.. I used the add force command to the sphere and it it works fine at position A but at position B, it stops moving and goes in the opposite direction. I then tried the add relative force and it still did not work. It just stalled at position B. My question is how do I get the sphere to travel the entire circuit without stopping.
HI, I am working on a similar game. Did you figure out a way of doing it?
Answer by lancer · Aug 03, 2013 at 05:49 PM
Try attaching this script to the rollercoster gameobject:
#Pragma strict
var CosterSpeed : int = 30;
function Update () {
rigidbody.AddForce(transform.forward * CosterSpeed);
}
Your answer
Follow this Question
Related Questions
Imported model is rotated 90 degrees off of straight, can't use any transforms 1 Answer
Relative force 1 Answer
relativeVelocity how to? (noob question) 2 Answers
AddForce Relative to Rotation 1 Answer
Add Relative Force 2 Answers