Hi, i’m new in this and i saw the tutorial video of: Roll-a-ball, i start yesterday.
Now, my problem is when i put the script on the GameObject Sphere, the sphere fly away. It’s a rigidbody and have check “use gravity” . But doesn’t work.
Here the script:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour{
void Start (){
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0x0f, moveVertical);
rigidbody.AddForce (movement);
}
}
I tried add mass to the Sphere with “rigidbody.mass 0x05” or something like that… But no, doesn’t work again.
Thanks.