t2dSceneObject.clone() problem in 1.7.4
by Merfy · in Torque Game Builder · 03/23/2009 (8:16 am) · 1 replies
I have a single t2dStaticSprite on my level which I use to clone to spawn many other sprites. I do it this way because I have set the collision poly and a few other things I'd rather not have to explicitly code and because I might have to change these things as development progresses, and rather not have to change the code ever time.
One of this most important things I have set is the Class. I use the class's callbacks to respond to mouse clicks, collisions, and world limits.
The problem is that the cloned objects never trigger ANY of the callbacks. I have tried setting the .Class manually after the .clone() but it still does not trigger any callbacks. The best I can tell, the cloned object isn't really getting the correct namespace of the source object. Is there something else I need to do after the .clone() so that the object is in the correct Namespace so callbacks will fire? It's seeming to me this is may be a bug in the engine, but just wanting to make sure I'm not missing something.
If this is a bug, is there any way to work around this somehow so I can make copies of existing objects where the copies also are in the namespace of the source object.
One of this most important things I have set is the Class. I use the class's callbacks to respond to mouse clicks, collisions, and world limits.
The problem is that the cloned objects never trigger ANY of the callbacks. I have tried setting the .Class manually after the .clone() but it still does not trigger any callbacks. The best I can tell, the cloned object isn't really getting the correct namespace of the source object. Is there something else I need to do after the .clone() so that the object is in the correct Namespace so callbacks will fire? It's seeming to me this is may be a bug in the engine, but just wanting to make sure I'm not missing something.
If this is a bug, is there any way to work around this somehow so I can make copies of existing objects where the copies also are in the namespace of the source object.
About the author
Torque Owner Shaderman