Game Development Community

Strange anomaly with object positioning?

by Laurence Grant · in Torque X 2D · 01/05/2007 (11:34 am) · 6 replies

I have an object I'm moving around the screen with the SetPosition method, I've also tried the WarpToPosition (same results). I'm setting Visible to false, then after a few seconds (even minutes) I set the new position and then set Visible to true. What's happening is I see a flash of where the object used to be before seeing it at the new location. This is not the behavior I'm looking for; I want it immediately visible in the new location, with no ties back to the old location. Am I doing something wrong?

#1
01/05/2007 (2:07 pm)
SetPosition should exhibit the behavior you describe and WarpToPosition should not.
#2
01/05/2007 (8:24 pm)
Thats what I thought after reading it, but it didn't fix it, so I thought there must be something else I'm still not doing right. I've done a search for all SetPositions and set them all to WarpToPosition, and still same results. I'll keep testing, and I think I know a work around, but it's a kludge, and I'd rather fix it right. If anyone else has any ideas/suggestions, please let me know.
#3
01/06/2007 (10:59 am)
Have you at any point set your project to interpolate ticks rather than have fixed ticks? That might muck things up a little.
#4
01/07/2007 (10:08 am)
Don't know how you would do that, but I'm using the SpaceShooter demo is the baseline. Do you know what that does?
#5
01/07/2007 (11:06 am)
That would use fixed ticks.
#6
01/07/2007 (11:36 am)
@Laurence, does the object have a physics component? If it doesn't, you might try adding one to see if that fixes the issue. If it does fix the issue then I think I know what is going on.