Ive just started learning about this so i don't know what im doing. Currently following the official tutorial 'Make A Ball Game'. Got as far as finishing the script, which is identical to the tutor's script, but i have errors and he doesnt. Different version? Missing software? What should i do?
Lol! Yeh. Probably better! using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { private Rigidbody rb; void Start () { rb = GetComponent<Rigidbody> (); } FixedUpdate {} float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical"); Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); rb.AddForce {movement}; } }
Yes. Enclose you script in [ code=CSharp] [ /code (without the space) or use the 6th icon from the right in the editors icon bar.
The error is at FixedUpdate, you can't just put a function like that, you need a void before it, so the game actually knows, that it's a function, and a (), because of the same reason.