Hello to all,
Still in the process of trying to finish my first platform game and I need a bit of help regarding adding an "invincibility" behaviour to main main character.
Currently I have my Player actor aka Hero set up like this in term of animations
- walk (left + right) ; jump (left+right); shoot (left _ right); Hurt(left+right); Die (left+right); Dead (left +right); duck (left + right);
Once my Player gets hurt by an obstacle (ex. spikes) he gets trown a bit back and up in the air.
Inside my hurt behavior I would like to add a part to handle invicibility like this:
-After the Player takes damage, start to Flicker and become invincible for 3 sec. While invincibility is ON I would like the player to be able to pass through enemies and obstacles.
My problem is that I don't know how to make the Player be able to pass through enemies and obstacles (not register collisions) while invincibility is on.
Currently my Hero Character aka Player can collide with : Tiles, Enemies, Obstacles, Enemy Fire and Collectibles
I've searched the forum and found an option of using multiple collision boxes for the Player, yet I don't know which code blocks to use in order to switch to a collision box that is inside a group that won't collide with the Obstacles/Enemies/Enemies Fire group for example when the invicibility is ON.
I attach my Hurt Behaviour here in case one that can help needs to have a look and also to ask if there is a more optimized/elegant way to code it.