Search Unity

Triggerenter2d hierarchy?

Discussion in '2D' started by guildmaster2017, Jul 31, 2018.

  1. guildmaster2017

    guildmaster2017

    Joined:
    Apr 5, 2018
    Posts:
    5
    Hi guys,

    I’m working on a 2d rpg similar to the old school Zelda if it met Skyrim. We have blocking and deflections but they only seem to work when they want to work. I have a player parent that holds the dynamic rigid body collider that will take damage when hit by the enemies sword static trigger collider. And the player has shield and sword children attached that have kinematic trigger colliders. When the block animation is called it enables the collider and when the sword animation is called it enables the collider for one frame. Only problem is when the player and enemy are too close and I block when he attacks then it should knock him back and register as a shield hit. However, the sword collider appears for just one frame and triggers the players collider and shield collider at the same time so it mostly takes the players collider as precedence. It was working with the shield for a long time but just stopped working yesterday even though I haven’t messed with it.

    Any advice as to whether some trigger interactions take precedence over others?

    PS: The triggers hit at the exact same time every time since the sword trigger is activated on one frame during animation.

    Any and all advice helps, thank you.

    Oliver