1.5.1 CloneWithBehavior does not copy class
by James Ford · in Torque Game Builder · 08/30/2007 (2:58 pm) · 1 replies
I'm reposting because my original is in the TGB > Collisions and Physics forum and I now believe this is a bug or oversight.
In summary, I think clonewithbehaviors should have an optional boolian parameter as clone does, specifying to clone dynamic fields (like class), because without it you lose the ability to clone an object which has both behaviors and a class you wish to copy. Also I noticed manually assigning the class field of the clone to the template did not result in the class::oncollision callback getting called. I assume assigning a class when you create an object does something different than setting the class field at a later point after creation?
Original Post:
www.garagegames.com/mg/forums/result.thread.php?qt=66639
In summary, I think clonewithbehaviors should have an optional boolian parameter as clone does, specifying to clone dynamic fields (like class), because without it you lose the ability to clone an object which has both behaviors and a class you wish to copy. Also I noticed manually assigning the class field of the clone to the template did not result in the class::oncollision callback getting called. I assume assigning a class when you create an object does something different than setting the class field at a later point after creation?
Original Post:
www.garagegames.com/mg/forums/result.thread.php?qt=66639
About the author
http://jamesdev.info
Torque Owner Spider
And I think the default behavior should be to copy the class and superclass!