Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

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?
     
unityunity