You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make object 1 to follow object 2, within a fixed time(when object 2 moves to opposite direction, it should makes object 1 to move faster in order to keep the whole move time fixed).
Problem 1: The following codes do not work at all. obj1 doesn't move at all. Not sure if it's a bug.
var tweener = obj1.transform.DOMove(obj2.transform.position, 5f);
tweener.OnUpdate(() => {
tweener.ChangeEndValue(obj2.transform.position);
});
Problem 2: Using the following codes, obj1 moves and follows obj2. However its speed reduces gradually and never reaches obj2. I think the ChangeValues call must have reset the duration to 5 somehow.
If I know how to get the remaining duration time of a tweener, and maybe this following codes may work properly. But I haven't found a way to get te remaining duration in documentation.
I want to make object 1 to follow object 2, within a fixed time(when object 2 moves to opposite direction, it should makes object 1 to move faster in order to keep the whole move time fixed).
Problem 1: The following codes do not work at all. obj1 doesn't move at all. Not sure if it's a bug.
Problem 2: Using the following codes, obj1 moves and follows obj2. However its speed reduces gradually and never reaches obj2. I think the ChangeValues call must have reset the duration to 5 somehow.
If I know how to get the remaining duration time of a tweener, and maybe this following codes may work properly. But I haven't found a way to get te remaining duration in documentation.
Any help is appreciated, thanks!
The text was updated successfully, but these errors were encountered: