Game Development Community

How do I mount rotated objects?

by Charlie Talley · in Torque X 2D · 02/07/2010 (9:19 am) · 2 replies

In TXB, when I mount a static sprite that's already been rotated, it shows up in the actual game as not having rotated. Am I missing something? Or is it not possible for me to mount rotated objects?

#1
02/08/2010 (2:36 am)
You can set the rotation of the object after mounting it, I believe that by default it inherits the rotation of the parent. If you are using the editor select the mounted object and deselect the track rotation checkbox under mounting. you can then set the rotation in the template reference section.

If you are mounting in code:

_thing.Mount(_parentObject, "mountpoint", true);
_thing.TrackMountRotation = false;

#2
04/24/2010 (3:24 pm)
There's two methods for mounting in code,

public void Mount(T2DSceneObject mountee, string linkPointName, bool ownedByMount);
        
public void Mount(T2DSceneObject mountee, string linkPointName, 
Vector2 offset, float rotationOffset, bool ownedByMount);

I like the second one because you can pass in a rotation.