|
0 registered members (),
16,643
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
simple question about ent_animate
#418364
02/24/13 07:06
02/24/13 07:06
|
Joined: Oct 2012
Posts: 53
kenced
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2012
Posts: 53
|
Hello. How can I animate back or reverse the animation of the entity smoothly. I tried this
int ctr=10;
while(ctr>=0){
ent_animate(my,"Take",my.skill1,0);
my.skill1 -= time_step*7;
ctr--;
wait(1);
}
the animation goes back but then its not smoothly animate. Thanks in advance.
|
|
|
Re: simple question about ent_animate
[Re: Ch40zzC0d3r]
#418367
02/24/13 08:46
02/24/13 08:46
|
Joined: Oct 2012
Posts: 53
kenced
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2012
Posts: 53
|
Thanks for response. Sorry,It should be like this?.
while(my.skill1>0){
ent_animate(my,"Take",my.skill1,0);
my.skill1 -= time_step*7;
wait(1);
}
but it do the same thing as the code above. How can I reverse the animation smoothly?.Am I doing it wrong again?.
|
|
|
Re: simple question about ent_animate
[Re: kenced]
#418373
02/24/13 09:59
02/24/13 09:59
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
hi, I guess you want to animate the entity and then smoothly animate back to its start position, isn't it? In that case you can use cosine function for the animation percent.
var nAngle = 0;
while ( nAngle < 360 )
{
ent_animate ( me, "Take", 50 - fcos ( nAngle, 50 ), NULL );
nAngle += time_step * 30;
wait(1);
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|