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.

Dark GDK / I can't make my object move and animate at the same time

Author
Message
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 4th Mar 2009 17:57
If i press the shift key (the key to move the object and to play the animation) the object will not play the animation until i release the shift key, what's the problem?

Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 4th Mar 2009 23:01
because sync is outside?

try this one insted


bool anim = false;
while( LoopGDK( ) )
{
if(dbShiftKey())
{
dbMoveObject(1,0.2f);
anim = true;
}
if(anim)
{
dbPlayObject( 1 );
anim = false;
}

dbSync();
}

Keep it simple.
Questions? Mail me
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 4th Mar 2009 23:41 Edited at: 4th Mar 2009 23:44
Hayer:

What are you talking about? The sync isn't "outside", it's right inside his main loop.

jontepd, the problem is that every time you call dbPlayObject( ) it resets the object back to its first frame. You need to call it once when you want to start the animation:



silenus
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 5th Mar 2009 00:10
I did it this way. ObjWasLooped is because I want after a movement the "stand" animation played



Login to post a reply

Server time is: 2024-09-30 19:27:48
Your offset time is: 2024-09-30 19:27:48