Topic: "Follow" lag

To know when the player can jump in my game I have a ghost box just below the player model and I do isCollisionTest(). I'd check the collision of the player but that's unreliable so I have a ghost object that clips through the ground a bit.
  The problem is that I need to either use

Re: "Follow" lag

Hi, welcome,
your message got cut.

Just in case, did you check the "YoFrankie" example,
or "Jules" in "Small Demos" ? : http://www.maratis3d.org/?page_id=53

There is a base for a 3rd person character in both examples.

Re: "Follow" lag

anael wrote:

Hi, welcome,
your message got cut.

Just in case, did you check the "YoFrankie" example,
or "Jules" in "Small Demos" ? : http://www.maratis3d.org/?page_id=53

There is a base for a 3rd person character in both examples.

If I edit it it still stays cut.
Anyway the issue is a 1 frame delay if you set an object to follow another object with a delay of 0, even if you manually set the position every frame.
I have seen the demo but not the code, although I don't think it applies.
edit: Here's the game so far
http://thebest100028.com/retrotails/marbleblast.zip

Last edited by retrotails (2014-01-05 21:31:26)

Re: "Follow" lag

Yes, there is typically a one frame delay, specially with the use of physics.
When not using physics, the delay can be removed by forcing the matrix update from script : updateMatrix(player)

This is because the game update happens as follow :

1 : script "onSceneUpdate"
2 : behaviors update
3 : scene update
4 : physics update
5 : matrices update

If you want a perfect attach with no delay, it's better to use parenting (edit > link selection).