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 / Controlling Animation Structure

Author
Message
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 28th Jan 2018 02:32
Hi all,

Im working on badminton project(still struggling) , after fixing collision problem im still in trouble in controlling 3d animation. Help me to draw out a good control structure and help me to set out on how to determine the end of animation before its proceed to next one. Currently my structure is like this

Do

playerinput()

Loop

function playerinput()

if getkeypress()=1

Animation=1

endif

Animate()

endfunction

function Animate()

if Animation=1

if getobjectisplaying=0

Playobjectanimation

endif

endif

endfunction

As you can see here, the getobjectisplaying is use to start object animation, and if have no idea on how to determine the end of Animation=1 since i one it to finish the animation uninterrupt before going to another state.

Can somebody help me?

Attachments

Login to view attachments
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 29th Jan 2018 02:58 Edited at: 29th Jan 2018 03:21
i found it!!! forget i ask. Thanks all.

EDIT: in case someone search for the answer, the get the end of the an animation is using getobjectisanimating(that i know) and to get specific "frame" to better manipulate the animation, let say the frame that my character punch the hardest is by using getobjectanimationtime. Actually it return "frame", but "time" make me overlooked this command.
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 5th Feb 2018 11:14 Edited at: 5th Feb 2018 11:15
Thanks for posting the answer. I was wondering this too and am about to implement 3D animations. Do you use bone animations or are these vertex animations?
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 5th Feb 2018 13:41
you can also do it like this
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 5th Feb 2018 14:26 Edited at: 5th Feb 2018 14:27
@phemox, im using bone animation

@smallg, thanks, i already restructure like your suggestion,thanks. My biggest problem is on how to control an animation that i only run once, let say jump.

Animation mode like 1-loop 0-run once made me confuse, if we wrote playobjectanimation on main loop, it will repeat regardless of the mode. So getcurrentanimationtime(which is actually frame) can save the day. But again, i believe there a better control that i dont know..
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 12th Feb 2018 21:21
Quote: " if we wrote playobjectanimation on main loop, it will repeat regardless of the mode. "


Yeah, it seems that putting it directly in the main loop will always restart it, loop it and even make it run at weird speeds.

From the paid Tutorial guide vol 2 I know you should be able to use select and cases to get proper animation going, but all of those do actively check whether or not an animation should start.

Login to post a reply

Server time is: 2024-04-25 21:53:34
Your offset time is: 2024-04-25 21:53:34