Advertisement
Purianite

Untitled

Mar 21st, 2012
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. http://puu.sh/lOui Collision of player object (named Player) with powerup block (named Powerup). Both have Box Colliders.
  2.  
  3. Code in Player script:
  4. function OnCollisionEnter (myCollision : Collision)
  5. {
  6. if (myCollision.gameObject.name == "Powerup")
  7. {
  8. powerLevel += 1;
  9. Destroy(myCollision.gameObject);
  10. }
  11. }
  12.  
  13. Do they need rigidbodies or something?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement