Hi again i am asking for some help i have a ton of errors!
ERRORS:
-
error CS0103: The name `movementspeed’ does not exist in the current context
-
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
3.error CS0103: The name `movementspeed’ does not exist in the current context
4.error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
CODE:
using UnityEngine;
using System.Collections;
public class FirstPersonController : MonoBehaviour {
public float movementSpeed = 5.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float rotLeftRight = Input.GetAxis ("Mouse X");
transform.Rotate(0, rotLeftRight, 0);
float forwardspeed = Input.GetAxis ("Vertical") = movementspeed;
float sideSpeed = Input.GetAxis ("Horizontal") = movementspeed;
Vector3 speed = new Vector3 ( sideSpeed, 0, forwardspeed );
CharacterController cc = GetComponent<CharacterController> ();
cc.SimpleMove( speed );
}
}
thanks! That solved all my issues but i have another where it says this, "The referenced script on this Behaviour is missing!" can you shed some light on the situation? (Btw, just started C#, literally yersterday)
– jmonkey2001You need to give context for this new problem. Script, line number, etc. Open it as a new question unless it relates directly to the script above.
– robertbu