Camera lags dynamic physics objects by one frame

Is there any way to make a camera follow a dynamic physics object exactly? All my (sensible) experiments seem to lag by a frame.

If you get your position in a game-object’s update function, it is (of course) the position at the beginning of the frame.

If you send a message to yourself, it seems to happen after all the update events, but the physics step still hasn’t run: you get the position from last frame.

The render script presumably happens after the physics step, but you can’t use the go.get_world_position (or any other go.* function) in the render-script.

I can send a ray cast with no groups, and the ray_cast_missed response seems to come after the physics step and before the render update, but that’s a pretty horrible hack.

I haven’t been able to find any sort of post-update or post-physics or pre-render message or trigger in the documentation. Am I missing something? Or is this engine really so mind-bogglingly badly designed that there’s no way for camera scripts to directly access the actual position at which a game object will be drawn?

1 Like