Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Changing animation instantly?

Author
Message
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 15th Aug 2016 07:48
Hi all,

I have problem on controlling the animation of my character with walk forward and step back animation.When i press W the character is animate by walk forward animation(with movement) but when i Press S the character not instantly change to step back but it finish some frame of walk forward animation before changing to step back.

Can somebody help?

Thanks
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 15th Aug 2016 16:07
are you using if GetSpritePlaying() = 0?
try calling StopSprite() if the frames are outside of the desired range first.
i.e.

life\'s one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 15th Aug 2016 23:27
Ops forgot to mention that im doing 3d. But in the help file also got this stopobjectanimation for 3d. Ill try that and report back. Thanks
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 16th Aug 2016 05:06
Quote: "I have problem on controlling the animation of my character with walk forward and step back animation.When i press W the character is animate by walk forward animation(with movement) but when i Press S the character not instantly change to step back but it finish some frame of walk forward animation before changing to step back.

Can somebody help?"

Sounds like it might be Tweening.
I think that needs to be 0 if you want to play animations directly.

I am just getting started with 3d in AppGameKit myself, so I may not be much help.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Aug 2016 00:11
I haven't used 3D in agk yet and apparently don't even have animation commands in my version.

But I'll take a guess. I'd say you have to stop the current animation first and manually set the frame to the first frame number in the backwards animation sequence. Your code would also help us.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 17th Aug 2016 08:35 Edited at: 17th Aug 2016 08:35
At the office right now but my code i remember somehow like this(not actual language)

if keypress(W)=1

if getobjectanimation(mesh)=0

playobjectanimation(mesh,"",1,10,0,0) //no tween

endif

endif


if keypress(S)=1

if getobjectanimation(mesh)=0

playobjectanimation(mesh,"",11,20,0,0) //no tween

endif

endif

As simple as this.

Thanks.
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 21st Aug 2016 05:15
Ok guys..this one sort out..


I use animation state check if it is not the current animation i want than STOP the animation and play the one i want and it tween better with the next animation

Thanks

Login to post a reply

Server time is: 2024-11-21 20:20:37
Your offset time is: 2024-11-21 20:20:37