Game Development Community

Mount Object Assistance Please

by Ronald J Nelson · in Torque 3D Professional · 06/03/2014 (10:45 pm) · 4 replies

I have done similar things in older versions of Torque, but that was some time ago and I may have forgotten a step.

First, I definitely want to mount an object that has collision, not an image.

So I am trying in the following example to mount an object to a mount node. I know that the node exists, but no matter what datablock or object type, I have not seen it work. It behaves like it was successful in the script and console window, but yet nothing happens.

I would appreciate any advice that can be offered. Thank you in advance.

function Eliminator3::onAdd(%this, %obj)
{
   Parent::onAdd(%this, %obj);
   %obj.mountable = true;
   
   %test = new RigidShape(){
      dataBlock = BouncingBoulder;
   };
   %obj.mountObject(%test, 13);

#1
06/04/2014 (1:10 am)
Without digging too deep into this, I'm guessing you'll find the boulder spawns at "0 0 0" in your level and begins falling if there's nothing there to stop it. If so, try changing it from a RigidShape to a StaticShape and see if it mounts properly. I could be reading this wrong, it's late here, but a quick scan of the code indicates that the only objects that support mounting with mountObject() are classes that derive from Camera, LightBase, SpawnSphere, Player, StaticShape and TurretShape.
RigidShape derives from ShapeBase and isn't in the list.
#2
06/04/2014 (2:45 am)
Funny, I noticed this the other day. I suspect you'll have to dig into the RigidShape source and implement mounting. I've added a row for RigidShape to remind myself (or anyone else) to look into it.
#4
06/04/2014 (7:04 am)
Yep, it does. I don't know why I didn't put it in.