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 DBPro Corner / Help with animation

Author
Message
BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 4th Sep 2009 07:16
Hello all. I am having trouble playing an animation when a variable (alive#) turns to 0.



(Note: that snippet is in my main loop). If I write "Loop object" it works fine... except for the fact that it loops and I only want the animation to run once, since it is the death animation.

What happens when I use the "play object" command, is it only seems to play the first frame or so then then it stops there..

It also seems to be playing my animation sideways :S... (Only on that animation), the others that I am using (I'm looping all the others) work perfectly.

Here is my code:



Thanks a lot!

ßõw§€r¥¤
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 4th Sep 2009 09:42
That's because it will keep on restarting the animation (from the first frame) for each loop cycle. You should have another variable to check against that tells you if the animation is already playing:


Why do you have Alive and enemy declared as floats though; these values should only ever be whole numbers?

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Sep 2009 09:44 Edited at: 4th Sep 2009 09:45
I'm not sure about the problem but one thing that may effect it is that you're using floats instead of integers for the object numbers. Drop the # at the end of any variable that will never have a decimal point.

Quoting the help files:
Quote: "PLAY OBJECT
These commands will play the animation data contained within the specified 3D object.

Syntax

PLAY OBJECT Object Number
PLAY OBJECT Object Number, Start Frame
PLAY OBJECT Object Number, Start Frame, End Frame

Parameters

Object Number
Integer
The object number

Start Frame
Integer
The start frame

End Frame
Integer
The end frame
"


Edit: Rudolpho beat me.

BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 4th Sep 2009 17:57
Thanks guys!! I don't really understand floats since I am new to programming but I removed all the "#"s for variables containing object numbers and those that will only be 0 or 1.

The animation now runs through the animation properly, but it still flips over sideways instead of backwards like it does in my animator.

Thanks a lot!

ßõw§€r¥¤

Login to post a reply

Server time is: 2024-11-25 01:51:02
Your offset time is: 2024-11-25 01:51:02