Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var playerObj : GameObject;
- var playerHealth : Health;
- function Start () {
- playerObj = GameObject.Find("/Player");
- playerHealth = playerObj.GetComponent(Health);
- }
- function Update () {
- }
- function OnCollisionEnter(other : Collision)
- {
- if(other.gameObject == playerObj);
- playerHealth.TakeDamage(5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement