Sprite jitters when camera mounted
by Jeremy Jones · in Torque Game Builder · 07/13/2007 (12:29 pm) · 7 replies
Hello all,
I purchased the EA version of Torque 2d ages ago but never really got into it. I recently downloaded TGB 1.5 and have encountered a problem.
When I mount the camera to a sprite then apply a force to the sprite, the sprite gets "jittery". The severity of the problem increases with the total velocity of the sprite. It also seems to be related to the mount force that I have set. The worst jitter occurs when the mount force is high. With the mount force set to zero, any velocity results in jittering.
The rest of the sprites in the scene seem unaffected, and the camera appears to pan smoothly. It just seems to affect the sprite that the camera is mounted to.
The camera is mounted to the sprite using the standard "sceneWindow2D.mount" function.
I couldn't find anything like this in the forums, but it is possible I missed something. Not sure if there is a work-around for this, but if anyone has any ideas I would love to hear them.
I purchased the EA version of Torque 2d ages ago but never really got into it. I recently downloaded TGB 1.5 and have encountered a problem.
When I mount the camera to a sprite then apply a force to the sprite, the sprite gets "jittery". The severity of the problem increases with the total velocity of the sprite. It also seems to be related to the mount force that I have set. The worst jitter occurs when the mount force is high. With the mount force set to zero, any velocity results in jittering.
The rest of the sprites in the scene seem unaffected, and the camera appears to pan smoothly. It just seems to affect the sprite that the camera is mounted to.
The camera is mounted to the sprite using the standard "sceneWindow2D.mount" function.
I couldn't find anything like this in the forums, but it is possible I missed something. Not sure if there is a work-around for this, but if anyone has any ideas I would love to hear them.
#2
07/13/2007 (10:37 pm)
I ran into this with the beta, and have just checked & confirmed it's still happening in the 1.5 release. With a mount force of 0, the object the camera is attached to jitters when it moves. By making the mount force 31, I seemed to avoid the jitter, at the cost of having the camera lag. Using a camera manager to move the camera as Tom suggested sounds like a viable workaround.
#3
07/14/2007 (5:29 pm)
Exactly the same thing is happening to me too.
#4
Keeping the total sprite velocity down to 6 or so and the mount force less then 20 seems to keep the jitter down.
Seems a shame to write a camera manager in script when TGB has the cool camera mounting options, but it sounds like the best bet right now.
Thanks!
07/15/2007 (2:19 pm)
Glad I'm not the only one...Keeping the total sprite velocity down to 6 or so and the mount force less then 20 seems to keep the jitter down.
Seems a shame to write a camera manager in script when TGB has the cool camera mounting options, but it sounds like the best bet right now.
Thanks!
#5
What would a camera manger function do - just replace the mounting function by writing your own?
07/17/2007 (1:22 am)
I'm getting the same thing with a camera mounted to a physics based player. Very slight jittering which only happens when the player is moving fast.What would a camera manger function do - just replace the mounting function by writing your own?
#6
The camera and player updates can't be happening on the same frame, I'm guessing?
If I find a solution, you'll be the first to know.
P
11/05/2007 (7:08 pm)
I got the same problem, using setCameraPosition with the players x,y pos, has the same jitter problem,The camera and player updates can't be happening on the same frame, I'm guessing?
If I find a solution, you'll be the first to know.
P
#7
We're still waiting for the fix from GG...
11/05/2007 (7:10 pm)
You can find a more extensive topic about the issue here : www.garagegames.com/mg/forums/result.thread.php?qt=64825We're still waiting for the fix from GG...
Associate Tom Eastman (Eastbeast314)