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

im getting the errors "Assets\PlayersController2D.cs(28,10): error CS1513: } expected" and "Assets\PlayersController2D.cs(29,45): error CS1525: Invalid expression term '||' " how can i fix this?

$
0
0
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayersController2D : MonoBehaviour { Animator animator; Rigidbody2D rb2d; SpriteRenderer spriteRenderer; // Start is called before the first frame update void Start() { animator = GetComponent(); rb2d = GetComponent(); spriteRenderer = GetComponent(); } // Update is called once per frame void Update() { if (Input.GetKey("d")) || Input.GetKey("right"); { rb2d.velocity = new Vector2(2, 0); } { else if (Input.GetKeyDown("a")) || Input.GetKeyDown("left"); rb2d.velocity = new Vector2(-2, 0); } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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