Help me im trying unity for the first time and i copy a tutorial but this came up when i tried to test it
this is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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 monement = new Vector3
(moveHorizontal, 0.0f, MoveVertical);
{ rb.AddForce (monement) }
}
“Unexpected symbol ‘end-of-file’” pretty much always means you have mis-matched brackets somewhere. You can find them by counting the opening and closing brackets and making sure they all match.
I reformatted your code in my editor, you had an extra opening { before rb.AddForce.
You also have a typo in your GetComponent (its Rigidbody, not rigidbody), and Input.GetAxis should have a capital G.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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 monement = new Vector3(moveHorizontal, 0.0f, MoveVertical);
rb.AddForce(monement);
}
}