Have a problem with this scene?
Point is to move ball thou translation, not with force
I am moving the ball with this script
public class PlayerControl : MonoBehaviour
{
public float speed ;
// Use this for initialization
void Start ()
{
Debug.Log (Application.loadedLevelName);
}
// Update is called once per frame
void Update ()
{
}
void FixedUpdate ()
{
float step = speed * Time.deltaTime;
if (Input.GetKey (KeyCode.RightArrow)) {
Debug.Log ("keypress right");
transform.Translate (Vector3.right * step);
}
if (Input.GetKey (KeyCode.LeftArrow)) {
Debug.Log ("keypress left");
transform.Translate (Vector3.left * step);
}
if (Input.GetKey (KeyCode.UpArrow)) {
Debug.Log ("keypress up");
transform.Translate (Vector3.forward * step);
}
if (Input.GetKey (KeyCode.DownArrow)) {
Debug.Log ("keypress down");
transform.Translate (Vector3.back * step);
}
Debug.Log ("step is: " +step);
//float horizontal= Input.GetAxis("Horizontal");
//float vertical = Input.GetAxis ("Vertical");
// Vector3 move = new Vector3 (horizontal, 0, vertical);
// rigidbody.AddForce (move*Time.deltaTime,ForceMode.Impulse);
}
}
Scene can be downloaded https://dl.dropboxusercontent.com/u/83114758/Assets.zip
As video shows ball can get stuck inside box collier, go throw collier and gets launched to to infinity?
I have started learning unity a few days ago, I may have made a mistake somewhere.
Every one thanks in advance for your help.