Welcome,
Guest
. Please
login
or
register
.
April 22, 2026, 06:22:48 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Chain Pingpong Tween Position
« previous
next »
Print
Pages: [
1
]
Author
Topic: Chain Pingpong Tween Position (Read 3290 times)
singh029
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 28
Chain Pingpong Tween Position
«
on:
June 02, 2014, 05:24:03 AM »
Could you suggest a way to pingpong 2 sprites using OnFinished or when the sprite equals a certain position.
I want to have the second sprite start after the first one gets back to its initial (from) position.
The logic is wrong. Since Pingpong is endless, how do i check if it reached its initial position again so i can start the second sprite?
void
Update
(
)
{
if
(
leftPosTween
.
to
.
sqrMagnitude
>
new
Vector3
(
0
,
70
,
0
)
.
sqrMagnitude
)
{
rightPosTween
.
enabled
=
true
;
// set to false in Start()
rightPosTween
.
Play
(
)
;
}
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Chain Pingpong Tween Position
«
Reply #1 on:
June 02, 2014, 11:08:33 PM »
Don't use PingPong for that. Instead use linear interpolation, and change the curve to go from A at 0, to B at 0.5, then back to A at 1.0.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Chain Pingpong Tween Position