Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Daniele

Pages: 1 [2] 3 4 ... 23
16
P.S. If using DOTween Pro, remember to set the tween as paused (and even disable autoKill if you plan to call it multiple time, in which case you'll need DOTween.Restart("key") instead of just Play) :)

17
Hi,

If you're using DOTween Pro, just give you tween a special ID (like "key"), then call

Code: [Select]
DOTween.Play("key");
If instead you're doing it all by code, as long as you grab a reference to your key transform (or whatever you want to animate) you can tween it from anywhere.

Cheers,
Daniele

18
Ahoy!

Once you set the path, it's fixed, and indeed the "relative" option only involves the drawing part. But! There's a but! If you call myDOTweenAnimation.DORestart(true), your tween will be restarted by considering the current position of your object as the starting point, and readapting the whole path to it :)

Cheers,
Daniele

19
DOTween & DOTween Pro / Re: Tween overwriting
« on: March 31, 2016, 03:08:23 PM »
You could either use ChangeValues, or depending on the settings you want to change you could just chain them again and they will overwrite the previous ones (most chained settings can be applied at any time).

Also, in case of the same animation playing forwards or backwards (like a button press or a UI element entering/exiting), I usually just use the same tween (with SetAutoKill to false) and use PlayForward/PlayBackwards to switch its direction.

20
DOTween & DOTween Pro / Re: Tween overwriting
« on: March 30, 2016, 03:28:01 PM »
Hi,

I have to confirm there's no overwrite in DOTween. Its previous version, HOTween, had it, but I decided not to implement it in DOTween because the only way to have it is to use Reflection, and I wanted to avoid any of it this time (mainly for performance reasons).

Consider though that you don't need to kill a tween in order to allow an overlayed one to play: you can just pause it.

Cheers,
Daniele

21
:)

22
For example you would do this:

Code: [Select]
Tween myPathTween;

void Start()
{
   // Get tween from DOTweenPath and attach callback
   myPathTween = this.GetComponent<DOTweenPath>().GetTween();
   myPathTween.OnWaypointChange(WPCallback);
}

void WPCallback(int waypointIndex)
{
   if (waypointIndex == 3) myPathTween.Pause();
}

// Call this method when you're ready to resume the tween
void ResumeTween()
{
   myPathTween.Play();
}

23
DOTween & DOTween Pro / Re: Textmesh pro DOText
« on: March 30, 2016, 02:32:18 AM »
Hi,

Saw your issue on the forum but you solved it already. Glad about that.

In general, consider that DOTween Pro comes with a lot of packaged additional libraries (for TextMesh Pro, 2D Toolkit, and for each version of Unity that introduced something new and tweenable). The setup unpacks the right stuff based on your project and Unity version, and deletes the rest.

Cheers,
Daniele

24
DOTween & DOTween Pro / Re: Animate object with moving endpoint
« on: March 28, 2016, 01:25:43 AM »
Hi,

You don't need to necessarily use Unity's UI. You can simply keep the "coin collector" in a separate gameObject that doesn't move (or that follows the camera in case you're moving the camera and not the background), then convert the coordinate system of the coin when it's touched, move it inside the "coin collector" parent, and tween it from there. Or you could use a pure UI approach as you mentioned. Whatever the solution, I would strongly recommend NOT to have a "coin collector" that moves, because indeed it would lead to tons of problems and math/performance/tween-value-updates calculations that are definitely not needed when you can simply solve it otherwise. It's better for the brain and for the overall performance :)

Cheers,
Daniele

25
DOTween & DOTween Pro / Re: Position flickering
« on: March 28, 2016, 01:18:57 AM »
Hi,

The issue there is that you're changing the same property at the same moment. Changing the localPosition of a target is exactly the same as changing its position. The difference is simply in the coordinate system, but they're actually both setting the same property, which is the position.

You should use a parent-child relationship there. Tween the parent, and use OnUpdate to set the localPosition of the child. That would create no conflicts because you would really be setting two different properties (of two different targets).

Cheers,
Daniele

26
Hi,

This is sadly a Unity bug with foreach (should be fixed when they update to a newer NET version).
Just reassign your item inside the loop and it will work:

Code: [Select]
foreach(var item in mylist){
  var it = item;
  it.transform.DOMove (position, 2, false).OnComplete(()=>{Destroy(it.gameobject);})
}

Cheers,
Daniele

27
DOTween & DOTween Pro / Re: DoTween Path issue with NGUI Sprites
« on: March 28, 2016, 01:10:18 AM »
Hi,

Uhmm I believe it might be because NGUI sprites use a different axis order than Unity's. Can you set it inside a parent, rotate it so it uses the same axis as Unity, and tween the parent?

Cheers,
Daniele

28
Hi,

You can use the OnWaypointChange callback to know when a waypoint changes, and react accordingly. If you're using a DOTweenPath and not a scripted one, you will first have to grab a reference to the tween itself, and than apply the callback, like this:

Code: [Select]
myDOTweenPath.GetTween().OnWaypointChange(myCallback);

Cheers,
Daniele

29
P.S. Apologies! I just saw that you already asked this question and I missed it. There was a giant flow of spam in the forum recently, and it kind of messed things up :B

30
Hi!

A DOTweenPath and a Tween/Sequence are two different things. So if you want to use OnWaypointChange you have to get the DOTweenPath's tween, and then add the callback to it, like this:

Code: [Select]
myDOTweenPath.GetTween().OnWaypointChange(myCallback);

Cheers :)
Daniele

Pages: 1 [2] 3 4 ... 23