Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: JeppeNygaard on June 29, 2012, 10:06:55 AM

Title: follow a new target, while walking
Post by: JeppeNygaard on June 29, 2012, 10:06:55 AM
Dear all,

I'm new to the wonders of Playmaker so please excuse the following questions if it sounds a little newbie'ish

I have a pretty basic RTS setup where I'm looking down onto a map. When I click the map a character moves towards to point (vector) generated from where I clicked - the character moves using an iTween action with easeIn/easeOut - this all works perfectly - my problem is that I would like to be able to select a different target for my character WHILE the character is moving, thus breaking the iTween which is active and changing to a new one with this NEW target ... is this at all possible?? ... any help will be greatly appreciated!!

Thanks
Jeppe
Title: Re: follow a new target, while walking
Post by: yezzer on June 30, 2012, 08:20:43 AM
Not used iTween with Playmaker, but there's bound to be a iTween Stop action?

If you have Unity pro, you might want to look at using the navmesh, there's playmaker actions for that (separate download). That way you'll get proper pathfinding.
Title: Re: follow a new target, while walking
Post by: Horror on June 30, 2012, 11:42:50 AM
I'm only a playMaker noob myself, but could you add a Bool Test to the same state that you have your iTween action? Make it check if a new target has been selected every frame, and if it has, you can flow out of the current state and into another that will assign the new target.

You could also maintain a separate FSM outside of the FSM that you are using for your character. The extra FSM would check if a new target has been selected and then use a Send Event action to jump to a specified point in your character's FSM.

I found this tutorial helpful:
Title: Re: follow a new target, while walking
Post by: jeanfabre on July 02, 2012, 02:25:13 AM
hi,

 For your purpose, I would use either the pathFinding system built in Unity pro or use a different set of actions.

 try for example "movetowards", that will allow you to move the target and yet still follow it.

bye,

 Jean
Title: Re: follow a new target, while walking
Post by: JeppeNygaard on August 04, 2012, 08:03:26 PM
Thank you for all your replies and thanks Jean for pointing me in the right direction. I've come a lot longer now using the pathfinding system - VERY helpful!