Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- // BirdControl.js
- // stuff goes here...
- function FixedUpdate() {
- // ...
- if (h > 0) {
- rigidbody2D.velocity = new Vector2(speed, rigidbody2D.velocity.y);
- } else if (h < 0) {
- rigidbody2D.velocity = new Vector2(-speed, rigidbody2D.velocity.y);
- } else
- rigidbody2D.velocity = new Vector2(0, rigidbody2D.velocity.y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement