|
I have a problem with my static varible, in a collision of my projectile i call it and minus 10 for the damage the projectile does, no i don't know weather its my collision scrip that is wrong or my static var that's not picking it up this is my collision Code
that code is on my projectile it should minus HP when it hits the enemy ?
(comments are locked)
|
|
Do a
In to the function OnCollisionEnter... Then in the if statement, put:
Now run, and tell me if both, or only one comes up. Posting as answer so I can format it. it seems like the problem is with the collision, not the HP after more testing i find i can get the HP to lower in other circumstance but not with that code attached to the variable i wonder if this is because i destroy the variable?
Jan 06 '11 at 08:39 PM
AtomicMarine
its not because i destroy the object, i moved the destroy code around and still no luck, even tried adding to the lifespan, How would I do a check to see if this initiated object has hit a certain tagged object?
Jan 06 '11 at 08:44 PM
AtomicMarine
Thanks solved it, code was right, Taggin was wrong tyvm
Jan 06 '11 at 09:10 PM
AtomicMarine
Okay, sorry, I was AFK. Um, just so you know, if you use the Debug.Log, it'll show you where your hitting a problem. Very helpful for the future =).
Jan 06 '11 at 10:06 PM
Justin Warner
thanks man :) it is what helped me out in this situation, and subsequently I marked your answer up :D
Jan 07 '11 at 03:23 PM
AtomicMarine
(comments are locked)
|
