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

not all code paths return a value and must declare a body for CheckIsValidPosition()

$
0
0
code errors are stemming from the bool CheckIsValidPosition() { Here is the code: float fall = 0; public float fallSpeed = 1; public bool allowRotation = true; public bool limitRotation = false; // Use this for initialization void Start() { } // Update is called once per frame void Update() { CheckUserInput(); } void CheckUserInput() { if (Input.GetKeyDown(KeyCode.RightArrow)) { transform.position += new Vector3(1, 0, 0); } else if (Input.GetKeyDown(KeyCode.LeftArrow)) { transform.position += new Vector3(-1, 0, 0); } else if (Input.GetKeyDown(KeyCode.UpArrow)) { transform.Rotate(0, 0, -90); } else if (Input.GetKeyDown(KeyCode.DownArrow) || Time.time - fall >= fallSpeed) { transform.position += new Vector3(0, -1, 0); fall = Time.time; } } bool CheckIsValidPosition() { }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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