playMaker

Author Topic: finish distance  (Read 2100 times)

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
finish distance
« 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
« Last Edit: October 02, 2013, 01:53:32 PM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: finish distance
« Reply #1 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

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: finish distance
« Reply #2 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
« Last Edit: October 03, 2013, 02:05:42 PM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/