Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Character movement in animation vs. in script

Discussion in 'Animation' started by Izmail360, Mar 6, 2018.

?

What is the best practice to handle character movement?

  1. Handle position change in animation.

    20.0%
  2. Handle position change in script.

    40.0%
  3. It does not really matter.

    40.0%
  1. Izmail360

    Izmail360

    Joined:
    Oct 11, 2017
    Posts:
    3
    Hello,

    I have come through couple of tutorials on the internet and as far as I understand, in order to move character, there are two approaches.

    1. Create animation, which would animate movement as well as change character position. Then in C# script, we would just pass parameter speed into animation and then animation would handle the movement itself.
    2. Create animation, which would only animate movement. No translation is be applied in any axis. Then in C#, we would take care of position change, based on speed.
    I really cannot choose, which approach I should use - as for me, both looks more less the same.


    Which approach is the right one (best practice) in
    A) 2D game?
    B) 3D game?

    Thanks