Serveral problems i have not found solutions for.

Hello everybody.

I’ve crawled the forum a lot but have not yet found answers. If i haven’t searched properly, im sorry.

I have two major problems.

The first one is how to access the “hierarchy” of the scene. I want to make it possible to add a custom object to the scenes hierarchy and make it appear in the editors hierarchy tab!
Do i have to derive my own class from “GameObject” only to make my object suitable? Are there certain function calls to achieve this?

Additionally i want to draw planes within that object but i have not yet found out how to achieve that because i dont know how to enter the drawing functionality of the editor/game.

Most of the tutorials i’ve found deal with basic translations.

Thank you all in advance.
Marc

The hierarchy is all associated through the Transform object. All GameObjects have a Transform. So if you specifically wanted to create a box connected to object X then you would say newObj.transform.parent=X.transform;

You can search the hierarchy in GameObject.Find by using slashes. So: track/roadways/section3/turn2 would give you the object turn2 deep within the hierarchy. (I am sure if I am wrong its not by much)

For drawing planes. I am not quite sure that I follow. Planes are infinite and thus have no edges. The Debug.Draw methods are about the only thing we have to go from. And you can also use the Gizmo.Draw methods, but they have to be used in the OnDrawGizmos method. Those are about the only tools I know of. for drawing in that capacity.

You can, use the OnDrawGizmos to move real 3d objects around and do all kinds of things automatically in the editor. by essence the editor is a game platform. :wink: