Hi, I would like to generate a gameobject that can be cloned (as well as customs methods with it). My idea is to:
extend mesh
add custom methods to object
be able to clone / instantiate whole “gameobject”. By whole I mean mesh + methods in object
hi @Deltakosh as some objects will have different materials, need a clone instead of instance (or so I think). But so far can’t get it to work on neither case.
On my original question, apart from wanting to be able to use different materials, I want to ‘copy’ (instantiate or clone) whole code and mesh as an object, so that it could be encapsulated as a whole. What is it that I’m missing?
HI @Johnk, seems like a good approach. My conceptual issue there, is:
a) load the mesh, then
b) how to inform the class that said mesh is ready to be instantiated.
But still don’t know how to reference mesh, as I can’t link callback function to class, so had to use a timer to wait (not ideal, as different people = differente loading speeds).
Tried to add the class definiton inside the callback, but of course didn’t worked.
Ideally mesh would be ready beforehand, but if it isn’t? So far the examples I’ve seen use built in primitives which seem to be real quick, or they generate the clones in the callback. But for something a generated more dynamicly, can’t seem to find something that fits