Physics question
by Joseph Bosch · in Torque Game Builder · 02/25/2013 (1:53 pm) · 1 replies
I have 16 static sprite objects spawning in the bottom left corner of my scene and 9 static sprite objects spawning in the top right of my scene. Each have a behavior with the following.
%this.owner.enableUpdateCallback();
%this.owner.setUseMouseEvents(true);
%this.owner.setCollisionActive(true, true);
%this.owner.setPhysicsSuppress(false);
the key one being %this.owner.setPhysicsSuppress(false);
the problem is the top units are forming nice neat formations when they spawn IE
---
---
---
while the bottom units are forming these awkward formations when they spawn IE
|
--
|
--
|
--
|
--
each set of units uses the same code to spawn, the change is that one set uses a different coordinate to spawn then the other, my question is why is the physics making a nice neat pattern for the top units and a messy pattern for the bottom units?
edit:
further investigation shows this is a problem with the %this.owner.setLinearVelocity(-5, 5);
one set has %this.owner.setLinearVelocity(-5, 5);
and the other has %this.owner.setLinearVelocity(5, -5);
Causing them to meet in the middle, the problem is this difference causes the change in formation for the units
%this.owner.enableUpdateCallback();
%this.owner.setUseMouseEvents(true);
%this.owner.setCollisionActive(true, true);
%this.owner.setPhysicsSuppress(false);
the key one being %this.owner.setPhysicsSuppress(false);
the problem is the top units are forming nice neat formations when they spawn IE
---
---
---
while the bottom units are forming these awkward formations when they spawn IE
|
--
|
--
|
--
|
--
each set of units uses the same code to spawn, the change is that one set uses a different coordinate to spawn then the other, my question is why is the physics making a nice neat pattern for the top units and a messy pattern for the bottom units?
edit:
further investigation shows this is a problem with the %this.owner.setLinearVelocity(-5, 5);
one set has %this.owner.setLinearVelocity(-5, 5);
and the other has %this.owner.setLinearVelocity(5, -5);
Causing them to meet in the middle, the problem is this difference causes the change in formation for the units
Associate Melv May
*MOVED*