|
Hi, I need o make a script that will make an enemy apply damage when it collides with the player, and when the player's health reaches 0, reload the level. Here's my simple script : Player Script :
Enemy Script :
I think its a simple script, when i use it on some enemies, my FPS dropped like hell with about 10 enemies on my screen ( only happened while using scripts ), and doesn't damage my player however they collide... is there any problems in this script? Can anyone tell me whats the problem?
(comments are locked)
|
|
What could be happening is that your enemy objects are colliding at a constant rate (a very fast rate, at that. With other colliders in the area, perhaps?). If this is true (and I'm assuming it's doing so every frame), then those 10 enemy objects are broadcasting a message every frame. If this were on a mobile device, you'd probably never even get the chance to load that particular level hehe. What you could do is:
ok il try that, thanks for the reply..
Dec 16 '10 at 04:04 AM
user-3061 (yahoo)
(comments are locked)
|
