Search Unity

Cinemachine and root motion

Discussion in 'Cinemachine' started by Arcana96, Jul 13, 2021.

  1. Arcana96

    Arcana96

    Joined:
    Jun 28, 2015
    Posts:
    28
    Hi,

    I'm setting up a darting forward roll in my game. Most of the player movement is just handled with the character controller. However, my roll animation has root motion and so I'd like to use that to have the character roll forward instead of in place.

    I'm using Cinemachine as my camera solution. So, when I switch to root motion and allow the character to roll forward the camera doesn't close the distance between it and the target.

    Is there a way to achieve this?

    thanks.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    You can use as a cm target a transform that is a child of the root object that gets moved by the animation. Either some node inside the character or an empty object that you add to it.