Quantcast
Channel: Questions in topic: "issue"
Viewing all articles
Browse latest Browse all 827

2D character wont move

$
0
0
Hello, i am a begginer to Unity and i was making animation first with my character then i added the ability for him to move but he doesent wana move with the script or in the scene view the movement script is very much the same as the one of CodeMonkey void Update () { float speed = 15f; float moveX = 0f; float moveY = 0f; if (Input.GetKey(KeyCode.D)) { moveX = 15f; } if (Input.GetKey(KeyCode.A)) { moveX = -15f; } if (Input.GetKey(KeyCode.W)) { moveY = 15f; } if (Input.GetKey(KeyCode.S)) { moveY = -15f; } Vector3 moveDir = new Vector3(moveX, moveY).normalized; transform.position += moveDir * speed * Time.deltaTime; }

Viewing all articles
Browse latest Browse all 827

Trending Articles



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