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

Multiple Enemy Collision Help

$
0
0
Hello, I am making a sword game, and I have an enemy that I want to kill the player. I have a working AI script, but when I tried to make an attack script, I failed. I want it so when you collide with it 2 or 3 times, it loads to a new level. Here is my current code: #pragma strict var timesToTakeToKill : float = int; var target = Transform; function OnColliderEnter(collision : Collision) { Die(); } function Die() { if(collision("Player", => timesToTakeToKill)); { Application.LoadLevel("MainMenu"); } } Please help! I am a beginner to Unity3D!

Viewing all articles
Browse latest Browse all 1488

Latest Images

Trending Articles



Latest Images

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