Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Transforming object on place of another object problem.

$
0
0
I have a problem with transforming one object on place of another. All I get with my script is that enemy is just disappearing. Here is code I am using: var hitPoints : float = 25; var GameObjectOfEnemy : GameObject; var enemy : Transform; var deadReplacement : Transform; function ApplyDamage (damage : float) { if (hitPoints <= 0.0) return; // Apply damage hitPoints -= damage; // Are we dead? if (hitPoints <= 0.0){ Die(); } } function Die () { enemy.transform.rotation = deadReplacement.transform.rotation; Destroy(GameObjectOfEnemy); }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>