Hello. I'm created a game similar to Marble Blast, but I do not know how to move the ball into the direction that looks at the camera, any idea? (I move the ball with physics)
If you want to use torque to roll the ball, apply it around the camera's rightward direction:- Code (csharp): rigidbody.AddTorque(camera.transform.right * torqueStrength); If you want to push the ball, add the force in the camera's forward direction:- Code (csharp): rigidbody.AddForce(camera.transform.forward * pushStrength);
Ah, ok!, thanks! but now I have other problem. The addTorque is not working well. The velocity is very slow, although increase, for example, if the velocity is: 100 and later I change the velocity to 200, the ball rotate to the same speed that 100. Why?
hi, i hav created a slope plane and over which i have ball located to the bottom and on the swipe of the finger i need to move the ball in the direction i have swiped, and then apply a force so that it can be rolled over the plane to go forward. And the force applied over the ball can be determined by the length of the swipe in the vertical(Y) axis. Pls if some one have a demo or sample script that one could share to me. Thanks in advance