Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Identifier Expected Error

$
0
0
Error at (41, 21): Identifier Expected What does this error mean and how can I fix it in this context? public class PlayerMovement : MonoBehaviour { public Rigidbody2D rb; //Rigidbody public float facing; //The direction the player is facing (-1/1,left/right) // Start is called before the first frame update void Awake() { rb = GetComponent(); facing = 1; } // Update is called once per frame void Update() { if (Input.GetKey(KeyCode.A)) { facing = -1; Walk(facing); } else if (Input.GetKey(KeyCode.D)) { facing = 1; Walk(facing); } } void Walk(facing) <-ERROR ON THIS LINE { rb.velocity = new Vector2(20*facing, rb.velocity.y) } //This make it so if the player presses the run button at a standstill, they'll run in the last direction they walked }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>