playMaker

Author Topic: Temporarily disable collision  (Read 255 times)

ken168

  • Playmaker Newbie
  • *
  • Posts: 6
Temporarily disable collision
« on: June 08, 2023, 04:08:58 AM »

Hello everyone
When my fighter is hit by an enemy bullet,
I have a collision event that causes loss of health

At this time, I need my fighter to enter the invincible state.
At this time, when hit by other enemy bullets,
it will not take damage.

And enemy bullets must be able to penetrate my fighter plane.
Until the invulnerability state ends (about 3 seconds)

What to do to temporarily disable collision
Let enemy bullets penetrate my fighter?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Temporarily disable collision
« Reply #1 on: June 08, 2023, 06:38:39 AM »
Hi.
There are several ways, but it also depends a bit on how you set up your system and if you still want to get damage by other things.

for all damage, you can disable your trigger which is taking the damage (you should have a 2nd collider to handle damage and not use the one that holds your player on the floor)

you can also temporary ignore layer detection (set layer for bullets)