Scripting errors

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?

You should first post the code in CODE TAGS then tge errors, so people can help.

Yeah we’ll need to see the actual errors first before we can help you!

Lol! Yeh. Probably better!

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

private Rigidbody rb;

void Start ()
{
rb = GetComponent ();
}

FixedUpdate {}

float moveHorizontal = Input.GetAxis (“Horizontal”);
float moveVertical = Input.GetAxis (“Vertical”);

Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

rb.AddForce {movement};
}
}

Is there a certain method of posting “Code Tags” on here?

Yes. Enclose you script in [ code=CSharp] [ /code (without the space) or use the 6th icon from the right in the editors icon bar.

You need to change

FixedUpdate {}

into

FixedUpdate() {
1 Like

Or simply do insert/code, and yopy your code to there

And you forgot the errors, those are essential too.

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.