I would like to attach a Transform to a GameObject that would be editable in the inspector.
But not in the way "I have to add an existing Transform in the field “public Transform” " but more in the way “the transform is ALWAYS on the inspector, and I can modify it with arrows of movement and rotation”.
Something like an anchor.
It is because I have components that would always need this, and I don’t want to create too much GameObject ( I have a lot of component that would need this, and if i have to create 1 new GameObject per GameObject already existing, modify it, and then drag it in the field, it would be too long and really boring…).
Is there a way to achieve that?
I hope it’s understandable!
Thanks for all!
Best Regards,
R. Schim.
(I’ve made researches, but I lack this kind of vocabulary, and can’t find the good words to find it…)
Thanks for your answer!
I didn’t thought about Vector3. But would it be possible to have a visualisation of where the vector3 is?
I want to create a “tutorial to build an object composed with a lot of object that need to be assembled together”.
You have a all the object disasembled, and you pick 1 item, and you place it at the good place.
So, in my case, my need would be to have the final pos of the object without having to recreate a new gameObject everytime.
Thanks a lot!!
EDIT 1 : I just found about gizmos.
with ‘OnDrawGizmos’, I can add gizmo to the position property and maybe this is a way to go…
EDIT 2 : Nope, it doesn’t work. Gizmos are always displayed, so it would be unusable to have so much gizmos draw in such little place
If you want to manually position each component using the scene view, using a separate game object for each is probably the way to go. Even if you could create an embedded editor like you describe, that doesn’t sound like it would really be any significant reduction in the amount of work you need to do.
If possible, you should think about positioning your things algorithmically in a script, rather than positioning each one by hand.