Corrupted Castle
Code Snips - Root Motion
Code Snips - Root Motion
In the early stages of the project, the player used Root Motion to control how it moved during some actions. Although this went unused, I am happy to share how this worked as it was modular and designed to be used for any scenario.
Root Motion Translator - This component takes in Root Motion information and converts it into a Vector3 and Quaternion that can be read by other components.
Player Root Motion - Using the Root Motion Translator above, this takes the Root Motion Vector and outputs it so that it can be applied by the Player Movement Machine.
This is also divided by Delta Time as the motion taken in was already scaled by Delta Time, and the Movement Machine multiplies all the forces it takes in by Delta Time.