Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Yanifska on October 02, 2013, 01:50:58 PM

Title: finish distance
Post by: Yanifska on October 02, 2013, 01:50:58 PM
Hi there !

I need my camera to stop before the character in a top down game, and would like to have the finish distance option from the Move Toward action into the Itween Move To, or something similar.

I though I could just shorten the translate vector of the Itween Move to Action but I don't know how to do that manually since it tries to reach a specific point, instead of following a translate vector, so I can't shorten the vector.
And the math to do this manually is a bit over my head.....

How can I achieve this ? How would you go for it ?

Thank you
-Yaniv
Title: Re: finish distance
Post by: jeanfabre on October 03, 2013, 02:23:27 AM
Hi,

 iTween is not the way to go here. Have you tried "move towards".

 basically, you need for example to have a dummy gameobject attached to your character acting as a target for the camera position, and your camera follows that target, and not the player itself. If the target is behind the player then you have your system .

bye,

 Jean
Title: Re: finish distance
Post by: Yanifska on October 03, 2013, 02:03:30 PM
Jean;
I have tried the Move Towards action but it doesn't have easing.
I already have a target for the character to follow, I will try to implement a second target with an offset for the camera. 2 targets seems a bit overkill to me though.
I tried as well to have a null object, parent of the camera reach the target and the camera itself moving in the opposite direction by a few pixel to get this offset.
But I couldn' get a clean movement, it was verry jiterry.
I am still digging this.
If I find something nice I'll try to share.
see you