Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #pragma strict
  2. // BirdControl.js
  3. // stuff goes here...
  4.  
  5. function FixedUpdate() {
  6. // ...
  7. if (h > 0) {
  8. rigidbody2D.velocity = new Vector2(speed, rigidbody2D.velocity.y);
  9. } else if (h < 0) {
  10. rigidbody2D.velocity = new Vector2(-speed, rigidbody2D.velocity.y);
  11. } else
  12. rigidbody2D.velocity = new Vector2(0, rigidbody2D.velocity.y);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement