Game Development Community

TX 3.1.5: Mount & invisible

by Dwight Matthys · in Torque X 2D · 02/22/2011 (4:28 am) · 4 replies

Hi all,

I'm quite new to Torque X and before starting with the CEV version I was just playing around a bit with the "old" version 3.1.5.

Now I created 2 materials (A & B) in my editor and made templates of these, no object pooling (could be interesting to know).
Next I created a new component and added it to the B template. In this component in the _OnRegister method I create a new clone of template A by using the method CloneObject.
I set the position to the position of the SceneObject (B) and the layer to B its layer minus 1.
Then I register.

If I run this, everything shows up as expected.

Now when I add a linkpoint to B and mount my newly created object A to this linkpoint, object A is not visible anymore... As soon as I unmount it, it becomes visible again.

Any ideas?
Thnx in advance!

Dwight

About the author

Recent Threads


#1
02/22/2011 (11:23 am)
Found out that if I add the linkpoints to the template through the editor and mount my A objects to these then it works.
Is it too late to add LinkPoints when in the _OnRegister method of my component?

Thnx for some advice.
#2
02/22/2011 (4:09 pm)
Its suggested that you don't do that.. add components before registering the objects.
#3
02/22/2011 (11:46 pm)
Hey thnx for the info. I was just wondering, regarding "adding those linkpoints", are they considered components? The LinkComponent is already added via the editor, it just hasn't any linkpoints in it.

What would be the best place to add these linkpoints through code?

Thnx!
#4
02/23/2011 (2:31 am)
when you create a linkpoint in the editor it adds a linkpoint component to your object if it wasn't there before, I believe. You can manually add a linkpoint component while your in the editor if your set on creating linkpoints through code.