Game Development Community

Problems with StaticShape's movements

by Lluis Andreu · in Torque 3D Professional · 09/23/2009 (7:38 am) · 2 replies

Hi!

I'm trying to move and rotate StaticShape objects with the keyboard but, when I move a StaticShape object, the collision mesh remains in the same place.

Are there any way to move all together??

I made a video to show the problem:


Steps in the video:

1.Insert StaticShape object.
2.Set name to "chair"
3.setTransform() to move object
4.Object moved correctly inside the WorldEditor
5.Back to game
6.Select the object
7.Move the object with the keyboard
8.Check that collision Mesh remains in the same place
9.Back to WorldEditor
10.Object and Collision Mesh are separated.

I don't know why setTransform in the WorldEditor works correctly but in the game not.

This is the code that "move" the object when is selected.

function moveforward_1(%val)
{
   if(!$isSelected)
   {
      $move_fwd_1 = %val;
      moveforward();
   }else
   {
      if(%val)
      {         
         commandToServer('MoFo');
      }
   }
  
}

And function in the server:

function serverCmdMoFo(%client)
{
   %id = ServerConnection.getSelectedObj();      
   %vecTransf = %id.getTransform();
   %vecPos = getWords(%vecTransf,0,2);
   %newPos = VectorAdd(%vecPos, "-1 0 0");
   %id.setTransform(%newPos);
   echo(%id.getClassName());
   echo(%id.getPosition());
}

Thanks!

#2
09/25/2009 (2:47 pm)
Yeah, I saw after upload the video that I was using TGEA, sorry.

In the video you can see that the chair is a StaticShape object, not a TSStatic, but, anyway, I tested in T3D and it works!!!

I don't know why in the TGEA doesn't works and T3D yes.

Thanks for the explanation :)