- Home /
velocity direction
In my game, there is a ball that gets a velocity in the beginning, like this:
var velocity : float = 15;
function Start () {
rigidbody.velocity = new Vector3(velocity, 0, 0,);
}
Now the problem is, if I rotate the ball, it keeps on going along the global x axis (Even if I rotate the ball before the game starts, it just follows global x.). How can I make the ball follow its local x axis?
Thanks
Arne
Comment
ins$$anonymous$$d of new Vector3 do transform.forward * velocity
Your answer
Follow this Question
Related Questions
How to use local angular velocity? 1 Answer
C# Rotate velocity issue 1 Answer
velocity direction and reversing it 1 Answer
How do you limit velocity on a rigid body in only one direction? 1 Answer
Local Velocity for Rigidbody? 1 Answer