Search Unity

Script-based Root Motion ignores Collisions

Discussion in 'Animation' started by origamiunicorn, Sep 19, 2022.

  1. origamiunicorn

    origamiunicorn

    Joined:
    Dec 4, 2021
    Posts:
    2
    Ok. I have a hierarchy like down below.
    ->Player(Character Controller and Rigidbody attached.)
    --->Model(Animator attached. Root Motion not applied.)

    I have State Machine Behaviour script attached to attack animation and change transform position of parent OnStateUpdate.

    When my attack animation plays, my Player object enters inside of enemy collider. Then I thought that I use transform position update. This is the reason igroring of collider. I added collider in Model game object because Model have Animator component which uses root-motion and I just update transform of parent based on model. To prevent collision between Model collider and Player character controller, I added some layers to them and edited Layer Collision Matrix but not worked.

    So what is your suggestion?