mounting one ShapeBase object onto another
by Mikkel Hempel · in Torque Game Engine · 08/06/2002 (5:15 pm) · 0 replies
Im currently working on a turretclass.
I've created a TurretBody class and a TurretHead class which both are derived from ShapeBase.
Now is my problem how I can mount the head onto the body!?
In my scriptfunction TurretBody::onAdd(), I've initialized the head to %this.head where %this is the TurretBody.
Afterwards I've tried to mount the head onto the body by writing: %obj.mountObject(%this.head, 1);
%obj is ofcourse the TurretBody object. As you hopefully already have guessed: I would like to mount the head onto "mount1" in my Body-model.
When running the game I'll get no errors in the console, but when I place a new TurretBody with the worldcreator the Head dosent get mounted to the body, but is spawned at position (0,0,0) instead!?
Please tell me what to do!
I've created a TurretBody class and a TurretHead class which both are derived from ShapeBase.
Now is my problem how I can mount the head onto the body!?
In my scriptfunction TurretBody::onAdd(), I've initialized the head to %this.head where %this is the TurretBody.
Afterwards I've tried to mount the head onto the body by writing: %obj.mountObject(%this.head, 1);
%obj is ofcourse the TurretBody object. As you hopefully already have guessed: I would like to mount the head onto "mount1" in my Body-model.
When running the game I'll get no errors in the console, but when I place a new TurretBody with the worldcreator the Head dosent get mounted to the body, but is spawned at position (0,0,0) instead!?
Please tell me what to do!
About the author