Reputation: 1
Please help, I'm not sure what I'm doing wrong.
I'm following the Bolt Unity tutorial. When colliding with the enemy, the player is supposed to change to an Invulnerable state, at which point the Player object should not collide with the Enemy game object until after the exit state. This is done by changing the Player layer mask to PlayerInvincible and unchecking the collision matrix for PlayerInvincible & Enemies. However, although the layer masks change in real time correctly (I've tested it by watching the flow graphs during play), the player object still collides with the enemy in my testing.
I've checked the collision matrix and as far as I can tell it's set up correctly. Below are timestamps from the tutorial and screenshots of my setup.
Here's the tutorial where they demonstrate the player/enemy collision working as intended: https://youtu.be/lb38XBNxvbA?list=PLIJZVV88CLcuyjeS3FE7yHtGps_zxBLf6&t=338
Here's where they set up the health state, switching the layer masks: https://youtu.be/olHvE27uvOI?list=PLIJZVV88CLcuyjeS3FE7yHtGps_zxBLf6&t=1027
Collision Matrix
Player Health State Setup
Player Mask settings
Enemy Mask settings
Player mask changes in real time as expected, however player still collides with enemy object
Upvotes: 0
Views: 959
Reputation: 90769
What you show us in the first image looks like the settings for Physics (3D)
. I can see that since in Physics 2D
there is e.g. no option Enable Unified Height Maps
;)
Note that Unity has two completely separated, independent, unrelated built-in physics engines
Therefore there are also two different settings, one for 3D and one for 2D.
=> Since this is a 2D game using Collider2D
components you have to configure the collision matrix for Physics2D
!
Upvotes: 2