Collisions From a Distance
by rennie moffat · in Torque Game Builder · 09/13/2010 (2:47 pm) · 7 replies
Hi there,
A quick question.
I have an object, my player who moves about the screen using onMouseUp Calls. The onMouseUp Calls are tied to objects, sprites laid out through the level, so, if my object is at 30 33, and it is selected using onMouseUp, my player moves to 30 33. Capiche? The problem is, is that I may have a trigger, slightly off of 30 33, say at 38 33. When my player moves to 30 33, from a long distance, the length of the screen (camera view) he triggers that trigger even tho, collision bounds clearly show, when at rest, the player when at 30 33, is not touching the trigger at 38 33. It is like the system for a instant, quicker than the eye can detect is not fast enough to prevent the player from moving past that position of 30 33, and actually reaches 38 33, thus triggering the trigger.
I am wondering, has anyone seen something like this before? Is there any way to alleviate it? I have tried shrinking collision bounds, but I really can not shrink them any more with out compromising the game.
A quick question.
I have an object, my player who moves about the screen using onMouseUp Calls. The onMouseUp Calls are tied to objects, sprites laid out through the level, so, if my object is at 30 33, and it is selected using onMouseUp, my player moves to 30 33. Capiche? The problem is, is that I may have a trigger, slightly off of 30 33, say at 38 33. When my player moves to 30 33, from a long distance, the length of the screen (camera view) he triggers that trigger even tho, collision bounds clearly show, when at rest, the player when at 30 33, is not touching the trigger at 38 33. It is like the system for a instant, quicker than the eye can detect is not fast enough to prevent the player from moving past that position of 30 33, and actually reaches 38 33, thus triggering the trigger.
I am wondering, has anyone seen something like this before? Is there any way to alleviate it? I have tried shrinking collision bounds, but I really can not shrink them any more with out compromising the game.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
09/13/2010 (6:47 pm)
well, he sets it off anyways, but does not move thru it. If he starts to the left of it, he stops to the left of it, collisions not touching, however, the trigger is set off. Very weird. I have replaced the object trigger with a fresh one as sometimes things like that work. It is not a huge deal, as I have lots of triggers and it only seems to happen on a select few but if I could fix it, it would be great.
#3
09/13/2010 (8:25 pm)
Are you using a moveTo or something? Or are you simply setting his position to (30, 33)?
#4
09/13/2010 (9:15 pm)
MoveTo, with auto stop @ position reached.
#5
09/13/2010 (9:18 pm)
Maybe too large a "targetMargin" parameter? If it's too small the end-point may not be detected however. If it's too large then it may transition beyond the point you want it to stop but if "snap" is on then it'll snap back to the target position.
#6
Cheers.
09/13/2010 (9:25 pm)
Ok, I just looked and had not set any targetMargin. I will try that when I come across the next one that does it.Cheers.
#7
i.e if(!player)
09/14/2010 (1:04 am)
If you can't find a fix, just write it in your trigger function.i.e if(!player)
Associate William Lee Sims
Machine Code Games