How to get stable framerate.


I am trying to create a brawl game so I need to get the frames from actions exac.

My problem is that I wand to put a collision cube at the given frame of the action. But GE sometimes loose the frame and the collision never happens.

I play with python and I use object.frame to get the frame.

Also I use the same way to change the states between the action and the inputs but as I said when I loose the wanted frame nothing works as I expected.

Is there a way to get the frames or any trick to achieve that?


I…I, I quite don’t get what you’re trying to achieve… your explanation omits big chunks of information.
In my understanding, you are trying to add a Cube with collision, at a certain frame of an action? In that case, I’d use a delay sensor and the sensor that activates the action. The delay would count the frames needed to add the object.
If that’s not the case, well elaborate your problem better!

Print out the frame given to the python interpreter. This way you can see if the BGE is truly ‘losing’ frames (which I don’t think it is). If you’re using python, try using a range rather than an absolute value, i.e.

frame >=3 and frame < 4

is better than

frame == 3

because the frame variable could be 3.00001 (which isn’t 3, EXACTLY), and that could be the frame ‘loss’ that you talked about. EDIT: Printing the variable out would tell you this.