Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float moveHorizontal = Input.GetAxis("Horizontal");
- float moveVertical = Input.GetAxis("Vertical");
- Vector2 movement = new Vector2 (moveHorizontal, moveVertical);
- rb.velocity = movement * speed;
- rb.position = new Vector2
- (
- Mathf.Clamp (rb.position.x,boundary.xMin,boundary.xMax),
- Mathf.Clamp (rb.position.y,boundary.yMin,boundary.yMax)
- );
- if (Input.anyKey)
- rocketFire.SetActive(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement