playMaker

Author Topic: Itween move to with exisiting paths  (Read 23676 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Itween move to with exisiting paths
« on: June 04, 2012, 08:05:43 AM »
Hi,

 Following a post (http://hutonggames.com/playmakerforum/index.php?topic=1678.0), please find a modified version of iTween move to that accept the path name of any iTween path you have in your scene. you don't need to build it within the action anymore.

 It's called iTween Move to V2 to not conflict with the original one.

Get it from the Ecosystem



you can download the iTween path visual editor here:

http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/

create a path with that extension, give it a name and plug that name in the "path name" field of iTweenMoveTo_V2  and done.


 bye,

 Jean
« Last Edit: October 24, 2016, 11:42:11 PM by jeanfabre »

rojosedano

  • Playmaker Newbie
  • *
  • Posts: 13
    • View Profile
Re: Itween move to with exisiting paths
« Reply #1 on: June 11, 2012, 07:15:40 PM »
Hi, I can not make an object look in the direction of the path. I put the action ITween move to v2.
The object always looks to the last node in the path.
as is done? I'm doing wrong?

 ???thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #2 on: June 12, 2012, 12:08:28 AM »
Hi,

 You need to set the "lookAhead" property to something like "0.01" and it will follow the path, else it does look at the end of the path yes.

Bye,

 Jean

FlapFail

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Itween move to with exisiting paths
« Reply #3 on: July 04, 2012, 01:10:22 PM »
I'm sorry, but I am following your download URL now 10 times, it's like a circle :D
Am I stupid or why do I not find any download link to this custom action "iTween Move To V2" ??

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #4 on: July 05, 2012, 12:12:33 AM »
Hi,

 it's in the very first post of this thread as an attachment, I made a quick link below:

http://hutonggames.com/playmakerforum/index.php?action=dlattach;topic=1699.0;attach=975

Bye,

 Jean

FlapFail

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Itween move to with exisiting paths
« Reply #5 on: July 09, 2012, 01:35:36 AM »
omg, I looked at this post maybe 5 times and did not see the attachment :D

Thanks!

tnaseem

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Itween move to with exisiting paths
« Reply #6 on: August 25, 2012, 05:22:37 PM »
Just a heads up that the reverse path mode in this action doesn't work. In my version I replaced the line:

Code: [Select]
hash.Add("path", iTweenPath.GetPath(pathName.Value)) ;

with a check for the 'reverse' checkbox, and use the iTweenPath.GetPathReversed() function for the reverse path mode:

Code: [Select]
if(reverse.Value)
hash.Add("path", iTweenPath.GetPathReversed(pathName.Value)) ;
else
hash.Add("path", iTweenPath.GetPath(pathName.Value)) ;

You might want to update the action in the link above with these changes.

Cheers,
Tarique.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #7 on: August 28, 2012, 12:17:17 AM »
Hi,

 Thanks, I updated the download link.

 bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: Itween move to with exisiting paths
« Reply #8 on: March 18, 2013, 04:18:24 AM »
Hello -

Just now getting my feet wet with PlayMaker, and have high hopes. . . though still not sure if I'm going about things correctly.

I'm generating a spline with 8 randomly set points, using Vectrosity, and have put that script on an empty game object (named "randSpline"), to which I've also added an FSM.  I'm using 'Send Message' to trigger a 'ready' state once the spline (named "Spline", go figure) has been created.  From there I want to move another object (named "Circle") along the spline, also generated using Vectrosity.

In my first attempt, I added the iTweenMoveTo_v2 action to randSpline, changing the value of GameObject to "Circle", and Path Name to "Spline".  That didn't work . . .

I made a similar attempt by adding an FSM to the Circle object itself, but can't seem to get it to recognize the path by its path name . . . do I need to reference the spline generation script aht is attached to the randSpline object?  Just not sure how much needs to specified and how much is "known" within the PlayMaker context.

Any/all help would be greatly appreciated!

Thanks!

==rr

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #9 on: March 18, 2013, 05:48:27 AM »
Hi,

 iTween move to only works with path generated WITH iTween.

http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: Itween move to with exisiting paths
« Reply #10 on: March 18, 2013, 06:52:17 AM »
Aha!  Well, that's good to know.  I'll definitely try it with iTween "native".

Would you see any issues with maybe just passing the Vector3D array that defines the spline in my Vectrosity script to the Path Nodes parameter of the MoveTo_v2 action?

Many thanks for the very fast reply, really appreciate that!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #11 on: March 18, 2013, 06:53:45 AM »
Hi,

 no, that should totally feasible, but you'll need some scripting to do this, cause playmaker doesn't really offer this kind of data handling by default.

 Are you comfortable with scripting?

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: Itween move to with exisiting paths
« Reply #12 on: March 18, 2013, 07:21:35 AM »
Yes, I'm a decent scripter.  I think my true question now is more around PlayMaker architecture . . . right now I have an FSM on the object that's acting as the spline generator.  When the spline has been drawn, the script is firing a "ready" value through a boolean variable and triggers the listener:

if(ready){
   myListener.Fsm.Event("ready");
}

I've got that wired to another state which has the MoveTo_v2 action on it, and am referencing "Circle" as the GameObj.  If I'm planning on having a bunch of these circles animating on the same spline, with independent speeds and easing values, I'm thinking it makes more sense to put the moveTo action on the circle obj rather than on the listener . . . but if I do that, I'm not sure how I'd grab the vector array. 

On the other hand, if I keep it all on the listener, then I could just have a separate state for each circle, I suppose . ..  just not sure which is more efficient, and if it will bite me later on as this app grows . . .

Many thanks for the assist here, really appreciate it!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Itween move to with exisiting paths
« Reply #13 on: March 18, 2013, 10:28:38 PM »
Hi,

 Very good :)

don't hesitate to download the various port I did on the wiki, I am not saying they are the best and bullet proof examples, but that will surely give you some directions to explore and build up some expertize on that matter. If you master communication between playmaker and scripts, you will really build powerful stuff.


don't hesitate ot offload work on the gameObjects themselves, and keep the listener to a bear minimum, I find this to be the most flexible approach. the listener job is to listen and dispatch, not to care about what other objects will do with that call.

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: Itween move to with exisiting paths
« Reply #14 on: March 19, 2013, 06:28:08 AM »
Thanks very much, Jean, I'll definitely have a look at the wiki, and hopefully it will get me going in the right direction.  Right now I feel like I'm still shooting in the dark, as I'm not sure how to assign the Vector3 data to the individual Node x y z values . . . feels like a loop and some parsing might be in order, but am going to have a look at your work first.

Cheers,

=rr