Game Development Community

RESOLVED: iTGB v1.2: When the parent object moves using .moveTo(), mounted objects become jittery

by Dave Calabrese · in iTorque 2D · 05/15/2009 (7:47 am) · 7 replies

When you have 1 or more objects mounted to an object, and you use the .moveTo method on the parent object, the mounted objects become very 'jittery' during move, as if they cannot properly keep up with the moving object. This problem does not occur if you mount the parent object to a path and move it along that.

This problem occurs on all platforms (PC, OS X and iPhone/iPod Touch).

#1
05/15/2009 (7:59 am)
Did you set the mount force correctly? I don't have this problem and my mount force is set to 0.0 when I add it to the parent object. Of course none of my objects are moving faster than 64pixels per second right now.
#2
05/15/2009 (8:45 am)
@Bret: My mountforce is also set to 0. Here is how I am mounting it:

%parentObj.mountToLinkpoint(%mountingObj,1,0,0,1,1,1);
#3
05/15/2009 (9:36 am)
This is the code I'm using, it's in C but it's similar:
mDisplayName is a t2dTextObject
mDisplayName->setVisible(false);
mDisplayName->setFont("Arial bold");
mDisplayName->removeAllFontSizes();
mDisplayName->addFontSize(20.0);
mDisplayName->setLineHeight(12.0);
mDisplayName->setUsesPhysics(true);
mDisplayName->registerObject();
mOwner->getSceneGraph()->addToScene(mDisplayName);
t2dVector position = mOwner->getPosition();
position.mY -= mOwner->getHalfSize().mY/2;

mDisplayName->setVisible(true);
mDisplayName->setBlendColour(ColorF(1.0,1.0,1.0));
mDisplayName->autoSize();
mDisplayName->mount(mOwner,mountOffset, 0.0f, true, true, true, true);
#4
05/16/2009 (12:47 am)
Make sure the "child" objects also have physics enabled.
#5
05/20/2009 (1:38 am)
Yup, that fixes it. Would be nice if the engine would automatically trickle that setting down to attached child objects.
#6
05/30/2009 (1:36 pm)
Hmmm...I'm marking this as resolved, but I think Dave's most recent suggestion will be a good idea to implement in a new version of the engine.
#7
06/01/2009 (8:39 am)
Is this the same issue I was having using setPosition()?

www.garagegames.com/community/forums/viewthread/92243