Hi guys
First, i’m pleased with my first post in unity forum
I started by making rolling a rigidbody sphere with my finger, i started with small JS code, but i found strange problem, the code let me roll the sphere in right and left direction only, but i need roll the ball in ALL directions, i hope help me find my mistake.
The Code:
var speed : float = 0.1;
function FixedUpdate ()
{
if (Input.touchCount > 0 Input.GetTouch(0).phase == TouchPhase.Moved)
{
var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
rigidbody.AddForce(touchDeltaPosition.x * speed,touchDeltaPosition.y * speed, 0);
}
}