Hey guys.
I'm making a 2D Game.
I have a power up that, when the player touches, triggers a shockwave animation using 2d tool kit actions.
I'm trying to kill all enemies that are hit in the shockwave, as the shockwave hits them.
Here's how I tried to do it (I'm still new so bear with me).
- Character has rigid body (no grav. IsKinematic) + box collider + tag player
- Enemies have box collider with trigger + tag Enemy
- Power ups have box collider + trigger + tag Power up
Once player hits shockwave power up - I get power up collider component and remove trigger and add rigid body that has no grav. and IsKinematic. (So detection should function the same as Character, right?).
At this point I tried both a trigger event and a global trigger:
Trigger event: I checked if the trigger was the player, if so, I checked if the power up had been activated and looped back to the wait for trigger event. It only went through once and never detected enemies.
Global Trigger: Only triggered once unless I started the power up with rigidbody + not a collider trigger. If I did this, it would explode at the start of the scene (it was on top of enemies) but it would technically work and record multiple trigger enters. (had an int counter that increased each time).
So, any ideas? Am I going about this the right way?
Also, using 2D Tool kit - the box collider increases with each frame as the animation gets larger. Can I keep it this way and count on the larger box collider to grab new enemies as the animation gets bigger and touches them?
Any help would be great!