This question was
closed Sep 15, 2016 at 12:52 PM by
Landern for the following reason:
The question is answered, right answer was accepted
Question by
tanguy456 · Sep 15, 2016 at 12:51 PM ·
playertutorialroll a ball
roll the ball - player not moving. Script seems fine,Roll a ball not rolling, should I add speed ?
Morning,
Hope you are doing well. I closely followed the roll the ball tutorial, but still not successful. I saw many different versions of this code. Some adding "speed" notion (which would be fine for to add), but I'd like to understand how it would work on the tutorial without this "speed" value.
Windows 10, Unity 5.4.0.f3 Thanks for your help
Hereunder is the code snippet
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour
{
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement);
}
}
Comment
Best Answer
Answer by tanguy456 · Sep 15, 2016 at 09:30 AM
ok, I found the answer. " by using the keys setup on the input manager the ball moves in the scene." alright, I needed to find the input manager and see what was in it.. sorry for the disturbance.