-
Notifications
You must be signed in to change notification settings - Fork 0
Position
UnBocal edited this page Apr 1, 2026
·
2 revisions

UBTween.Position interpolates the position of an object.
| Target | Value changed (Ref Global) | Value changed (Ref Local) |
|---|---|---|
Transform |
Transform.position |
Transform.localPosition |
RectTransform |
RectTransform.position |
RectTransform.localPosition |
UBTween.Position(
transform, // Target Object
new Vector3(0f, 1f, 0f), // End Position
1f); // Duration
UBTween.Position(
transform, // Target Object
new Vector3(-1f, .5f, 0f), // Start Position
new Vector3(1f, .5f, 0f), // End Position
1f); // Duration
It's possible to whether translate the local position or the global position by using the Ref Enum.
| Target | Value changed (Ref Global) | Value changed (Ref Local) |
|---|---|---|
Transform |
Transform.position |
Transform.localPosition |
RectTransform |
RectTransform.position |
RectTransform.localPosition |
UBTween.Position(
transform, // Target Object
new Vector3(0f, 1f, 0f), // End Position
1f, // Duration
Ref.Global); // RefUBTween.Position(
transform, // Target Object
new Vector3(-1f, .5f, 0f), // Start Position
new Vector3(1f, .5f, 0f), // End Position
1f, // Duration
Ref.Local); // ReferencialUBTween.Sequence sequence = new UBTween.Sequence()
{
// Going Up
UBTween.Position(transform, Vector3.zero, Vector3.up, duration, Ref.Local) // Going Up
.SetEase(EaseType.OutExpo),
// Going Down
UBTween.Position(transform, Vector3.up, Vector3.zero, duration, Ref.Local) // Going Down
.SetDelay(duration)
.SetEase(EaseType.OutBounce),
}.Start().SetLoop();