Check Waypoints of a Path Tween
« on: May 09, 2015, 10:51:18 AM »
Morning All,

Is there any way to retrieve the waypoints from a current DoPath Tween?

I've had a google and search but couldn't find a answer. Did have a read through the code and I have a feeling there isn't a way, but thought I'd ask just incase.

Thanks Everyone in Advance,
Adam

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #1 on: May 09, 2015, 12:27:31 PM »
Hi,

Are you talking about the DOTween Pro visual editor, or the regular version of DOTween? In the first case, if you get the latest version here (you'll need to be fully registered to access that page), there is a new button in the DOTweenPath Inspector, next to the Waypoints group, that allows to copy to clipboard a formatted array of the current waypoints.

Cheers,
Daniele

Re: Check Waypoints of a Path Tween
« Reply #2 on: May 11, 2015, 08:37:37 PM »
Hi Daniele,

We're currently using the regular version of DoTween, I'm having an issue where my waypoints are getting a little messed up and was hoping there was a way to retrieve this information to help me investigate whats going on.

Many Thanks,
Adam

Re: Check Waypoints of a Path Tween
« Reply #3 on: May 11, 2015, 09:01:57 PM »
After a little further digging I believe I've found the problem.

I'm using Transform.DoPath in OnEnable() to create a pattern from a enemy. I then need to re-create the same DoPath but when the GameObjects transform is now in a different location.

Hope that makes sense. What I'm looking for is a way to create a DoPath where it doesn't start at the GameObjects transform but at a given Vector3 position, is this possible?

Thanks for your help.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #4 on: May 11, 2015, 09:10:00 PM »
Hi,

Right now it's not possible, since the tween will always consider the gameObject's position as the starting one (I chose to do that in order to make it consistent with the logic of the other tween types). But why you don't simply move the gameObject's position, when creating the new path, to where you want the first waypoint to be?

Cheers

Re: Check Waypoints of a Path Tween
« Reply #5 on: May 11, 2015, 09:14:24 PM »
Okay Thanks Daniele, I'll do just that.

I'll move the object back to its starting position and then get it to travel back to the point I require it to.

Reason for the above is because I'm developed a space shooter with a rewind power; I'm using DoTween for enemy patterns. So I sometimes need to start animations back at different locations.

Thanks for all your help!  :)  and the really quick responses!  :)

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #6 on: May 11, 2015, 09:29:29 PM »
Oh wait, maybe I can help more now that I understand better what you're doing. Let me see if I got it right.

You want to have the same exact path be translated as if it all started from a relative different position? Meaning the movement will be exactly the same, but it will simply happen on different coordinates based on where the gameObject is? So if the movement had the shape of an S, it will still move exactly like an S?

Re: Check Waypoints of a Path Tween
« Reply #7 on: May 12, 2015, 10:08:44 AM »
Mostly there.

During the game an enemy can be killed, if the rewind power up is used a new enemy is spawned (using Object pooling) which means I need to re-create the same path the original enemy had. The problem is the enemy could die at any point during the animation pattern, so I need to re-crate the path in the exact same location but with the gameobject in a different position.

So if the enemy died and was at the top of the S, I need the path to create as if he was at the start. I was thinking I could spawn the enemy at his start position and then control where he is in the animation by using the GoTo function.

If you can think of any better way I'm all ears :) Thanks

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #8 on: May 12, 2015, 01:44:56 PM »
If with "position" you mean "time position", then yes, Goto is certainly the best approach. But if instead you want to spawn the enemy at a random point, and still have it make a complete S it's not (but I could find a solution to do that). I'm not yet 100% sure of the usage, sorry. Do you have a video of what you'd like to do by any chance? Or a drawing?

Re: Check Waypoints of a Path Tween
« Reply #9 on: May 12, 2015, 10:06:39 PM »
It's where the waypoint starts which is causing the issue, hopefully this video will help show the problem a little better :)

http://gfycat.com/LankyBreakableGoosefish

Thanks for your help Daniele

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #10 on: May 13, 2015, 06:47:55 PM »
I think I understand better now. I was slammed today to push the new DOTween update, but I'll try to test a solution for this tomorrow.

Re: Check Waypoints of a Path Tween
« Reply #11 on: May 13, 2015, 10:29:50 PM »
That's okay.

I've changed my code which now always spawns the enemy at the same location and then controls his position using the GoTo, this has solved the issue of the waypoints getting messed about.

If you can think of any better ways that'd be awesome!  :D

Thanks.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Check Waypoints of a Path Tween
« Reply #12 on: May 13, 2015, 11:05:54 PM »
I am sure I can think of a better solution (if I truly understood). I made something like that for the Pro visual editor, where you can spawn objects wherever you want and the tween will re-adapt. But I'm certain I can do that with the free version too :)