Vector3 Moving The Player Scripting

When i am creating the script as the video says (Moving The Player video 3rd video in the beginners Roll A Ball video set) it says that Vector 3 shouldn’t be in there whereas in the video it shows vector3 in the script then the player moving fine this is the copy pasted script that i made based off of the video
[using UnityEngine;
using System.Collections;

public class PlayerConroler : MonoBehaviour
{
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis (“Horizontal”);
float moveVertical = Input.GetAxis (“Vertical”)

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

rigidbody.AddForce(movement);
}

}]

I made the Vector3 bold and Green so you can see what one i’m talking about. It keeps on saying the vector3 shouldn’t be there when i delete it it says movement shouldn’t be there and so on. I am new to creating games and such so i have no clue what to do next or how to fix it. Any suggestions?
By the way it is unity 4.5.5

You might need to be a bit more specific about what error you’re getting. I’m fairly sure there isn’t a “shouldn’t be there” error!

Also, use the [ code ] tags if you’re copying code in so it’s easier to read.

1 Like

Sorry i fixed the [ ] and it is a parser error unexpected symbol ‘Vector3’

You’re missing the semi-colon on the line preceding the Vector3 declaration.

There you go :slight_smile:

When the compiler says that it didn’t “expect” something, or that something was “unexpected”, it generally means that the compiler expected something else to happen (i.e. it’s wondering where the semi-colon is).

It’s a good thing to keep in mind - with this sort of warning, you generally want to look at the code just before the code that it’s complaining about.

Okay thank you for telling me now i can move on with the project :smile: