Mesh current animation frame - B3D
Blitz3D Forums/Blitz3D Programming/Mesh current animation frame - B3D
| ||
Hi Blitzers, how can I get the current animation frame of an animated .B3D model ? Suppose this scenario: I have a 3D model of a guy launching a frisbee. I would like that the frisbee is released at a specific frame of the whole animation. How can I achieve that ? I need the current animation frame, but as far as I know, I didn't find any command in the Blitz3D docs. Thanks in advance, Sergio. |
| ||
Are you using tweening? If not, you could use a counter in your mainloop to count the frames. And release the frisbee when the counter hits a certain value (so he'll release the frisbee after some predefined number of frames). Of course, you need to reset the counter to 0 when the animation sequence starts and increase the counter every frame if the character is doing the animation for throwing the frisbee. |
| ||
AnimTime# ( entity ) Parameters: entity - entity handle Description: Returns the current animation time of an entity. |
| ||
Thanks folks - AnimTime is exactly what I'm looking for - by the way, in my opinion it should be renamed to AnimFrame instead :) Cheers, Sergio. |
| ||
Not AnimFrame because if you're using tweening, your animated mesh won't necessarily be exactly on an integer key frame. A frame is just a quantification of time :) |
| ||
Ah I've got it now, thanks Tom :) |
| ||
Well in my opinion it should be GetAnimTime seeing as there is a SetAnimTime command. |