BGE Action glitch

I have a problem in bge, the Action actuator is set to play the frame that a certain property number is.
But it will flicker back and forth between the start of the animation and the property number.
How can I fix it?

thats floating point error i think. you need to set the end and start frames out a ways. so a 0 to 40 would be -5 to 45

I don’t know how to change the start and end frames of a action actuator when it is set to property.(tried it in python but it gave me the same results)

oh right, yeah, i forgot the start and end goes away. then copy the last and first frames in the animation?

what? I don’t need to copy the frames. what do you mean?

just so theres a “buffer” so the action doesnt think it hit the animation end

where do I copy the last and first frames to?

if anim 0-40, copy 40 to 45 and 0 to -5. if it wont let you go neg, then translate the whole action forward, copy frames, then translate back

so change the animation itself?

yes, i think its starting over because it thinks there are no more frames, so it tries repeating.

but i really dont know, you just have to try it and see.

well in that case this won’t fix it because I already tried that.
Thanks for your help.

This is a very frustrating problem I have had for the past few…well, for a very long time!
The Action actuator always plays the first frame of animation when u switch actions/animations…

So…to get around that :

1 - Simply set the visibility of the object to Invisible in the Physics tap.

2 - Add a Delay Sensor to your Initial State (Delay set to any number above 1… 3 to 7 works the best!) and connect it to a Visibility Actuator to make the object Visible again!

Voila!!! … Flickering is no more! :smiley:

1 Like

I actually just today was able to make a work around of my own.
I just set the action actuator to loop stop and set the start and end frames.
Then used this code I made to set the frame of the animation to the property.
And for some reason the flickering stopped.

import bge
import GameLogic

cont = bge.logic.getCurrentController()
own = cont.owner

scene = GameLogic.getCurrentScene()
objList = scene.objects
XP = objList[“XP”]

own[“Size”] = XP[“Text”]/20

acnACT = cont.actuators[“Action”]

acnACT.frame = own[“Size”]