playMaker

Author Topic: 2D Sprite "Move Towards" Not Working  (Read 1998 times)

DeathByRhino

  • Playmaker Newbie
  • *
  • Posts: 5
2D Sprite "Move Towards" Not Working
« on: September 28, 2015, 01:14:52 AM »
I'm trying to send my Bowser walking towards my player until an offset distance, then punch him. But Bowser only walks a few feet forward, then either continues walking through the player character or rubs up against him and THEN punches. Afterwards, he doesn't respond to a Move Toward back to his initial position. Help?

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: 2D Sprite "Move Towards" Not Working
« Reply #1 on: September 30, 2015, 07:09:11 AM »
The move toward action do this.
It go to the target and after stop + send event if necessary. Thats all.

If you like to use it continius (nonstop), you need to loop it as you like.
For example: after stop, in the next state you check if the target transform position is changed (so if the target moving) and go back again in to the move toward state.

But also you can use translate and and check if the distance is less than your float, it stop, and if the distance larger than your float translate the object again.
« Last Edit: September 30, 2015, 07:13:19 AM by Bqlqzs »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D Sprite "Move Towards" Not Working
« Reply #2 on: January 29, 2016, 12:56:26 AM »
Hi,

 you need to set the "finish distance" to 0 else the first time it reaches the target it will stop moving towards.

 Bye,

 Jean