- Home /
Keep RectTransform changes after animation
So I am developing a 2D grid game.
In one of my GameObjects I have an animation that changes it's RectTransform, making it move to another place on the grid. Thing is, when the animation finishes, the GameObject starts moving back to the original position and I want it to stay in the new position.
The animation controller has two states: idle and moving. Idle is the default and I change from idle to moving by setting a trigger variable when the player collides with it. The controller changes back from moving to idle on exit time.
Do I need a "second" idle state to force the gameobject to keep the new position? I really would like to avoid this since the idea is to move that character several times (kind of a cat and mouse situation, where the player has to chase the GameObject).
Thanks in advance, R.