When recording physics with game engine, f-curve animation does not work?

Hi All,

I am having a problem which may seem to be a bug. This used to work in 2.49, but now in 2.5.7 it does not seem to work.

I have an animated static mesh that interacts with a bunch of cubes. When I play the animation with the play button, the static box moves around the 3D space. The cubes are supposed to fall into the static box then get shuffled around.

But for some reason, when I press the P-Key to record the simulation Blender no longer honors the animation of the static box.

Does anyone know how to set this up so it works?

I have attached the 2.49 file so you can see how it used to work.


25_PHYSICS_FALL.blend (441 KB)249_physics_fall.blend (104 KB)

I think when I’ve done a similar thing in 2.5 I used the logic bricks to play the boxes animation with an f-curve actuator

It seems that all f-curves get overwritten when you record physics in the game engine. You can prevent that by clicking on the lock icon of the channel you want to preserve in the graph editor. With that you prevent the editability of the keyframes of that channel, and the the game engine physics recording won’t overwrite them.

Sanne that’s a good tip! it finally answers my first ever question on this forum :slight_smile:
Atom also set substeps to 5 and expand f-curve actuator time to fit your animation
hope aligorith’s gsoc 2010 were already here…

@Sanne: Thanks for the tip. I kind of wondered if the system might be overwriting my f-curve.

@Liero: I did set the sub-step to 5.

I am attaching a revised version with the lock enabled and substep = 5.

But there still seems to be a problem even with substep = 5 and the initial f-curve locked on my static box. The objects collide when I move the colider up and down, but not side to side???


25_PHYSICS_FALL2.blend (441 KB)

Open a logic editor window and setup endframe of f-curve actuator…
the actuator there is what does the magic :slight_smile:

Ah, I see now. The end frame was still set to 250 (default) and my animation went past that. I did not realize I needed to use the logic editor.


Once again I am playing around with this concept and have run into the “workflow” bug again.

I am in the same state I was in when I originally posted. I have some cubes that fall into a Static physics container. They come to rest and the container is moved. In the real world, the cubes should continue falling. But in this scene, they do not. Even though I have keyframed movement of the container, the Game Engine will not recognize that. Is that the nature of the Static collision type, not animatible? Is there another collision type that will work for this animated purpose?

Does anyone have time to take a look at my scene? I have set the substep to 5 and locked the Z-axis of the Static mesh that moves out of the way.


25_physics_fall_problem.blend (504 KB)

If you set an f-curve actuator to run the animation than they will interact. I also changed the physics FPS in the World settings to 60 to match the render FPS settings otherwise the timings didn’t match the scene correctly.


25_physics_fall_problem.blend (76.2 KB)

Thank you for looking at my file and posting a solution.

I have not used the logic panel in 2.5. So the connection you setup, Always, And, Play…Is that what makes the Static mesh move?
The actuator always ands the fcurve value with the physics value on a per-frame basis?

And you still need to remember to lock off the fcurve for all this to work.