In BGE, the actuators update before the physics does. This means that IK (updating in the logic/actuator stage) executes before physics. As a result you get an apparent one frame lag between the two. Consider this blend: IKLagTest-physics.blend (539 KB)
The ball (which is the target of the IK) has a slight motion relative to the top of the robot arm.
In object tab > relationship extras on the ball there’s a couple of “hack” options, maybe they will give the results you’re looking for.
I’m not sure, I can never get good results from physics so I’ve pretty much given up on it. All my games use fake physics.
Recently I had some trouble with a plane parented to the camera which didn’t update properly so the hud that was using it for a collision check didn’t work properly if the camera moved In that case I parented the hud to the camera too and it seem to work out OK. I don’t think that’d work here though since then physics would not affect the ball.
Usually the work around would be to have 2 different balls, parent the visible ball to the arm and then set the other with rigid body physics invisible, will that be good?
@Smoking_mirror:
I haven’t found any of those that work in the game engine.
It doesn’t surprise me that you’re doing that - because RTS’s generally don’t work well with generalized physics
@quramarx:
I may have to end up doing this, however I would (obviously) rather not. The actual system already has separate graphics and physics mesh, but there are moving parts+constraints+things on the end, so it will be a pain to set up.
Note:
Adding armature.run() to the scene.pre_draw callback didn’t fix it either - probably the armature has updated but the objects associated with it have not (or something like that)