Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: cel on February 14, 2012, 07:17:31 AM

Title: help with animation curves.
Post by: cel on February 14, 2012, 07:17:31 AM
I have a cube with a jump animation made in unity (it goes up a few pixels) I want that cube to move towards an object that moves (done) but I want the jump animation to play at the same time as it moves (done), the problem is that when i want the cube to move and jump again the cube goes back to its starting position... any suggestions on how to achieve this properly? Thanks in advance
Title: Re: help with animation curves.
Post by: speedything on February 14, 2012, 10:00:24 AM
Personally what I do is have three objects in a heirachy, something like...

Cube -> ANIM -> Model

- The 'cube' object will contain all the FSMs. I can also keep the scale as 1,1,1 regardless of the model's size which can have benefits.
- ANIM will have all the animations attached to it. This should have a position of 0,0,0 (in relation to the parent)
- Model will contain the visual elements. Again, this should have a position of 0,0,0.

This setup has a few advantages to placing everything in a single object, not least that if you want to change the model in the future it can be easily replaced at the lowest level.

For your problem, if you use the above setup you'll be able to move the 'cube' object whilst playing an animation on the ANIM object. This means that when the ANIM object finishes it's jump, the cube object (which it is following) will still have moved and not reset.