Game Development Community

OnAdd and onNewDataBlock

by Daniel Buckmaster · in Torque Game Engine · 11/04/2007 (8:05 am) · 1 replies

When are these functions called? I put echoes into them in script, but when I ran the engine, everything was quiet. Is there a function that is executed when an object is created through script or in the world editor?

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
11/05/2007 (9:35 am)
Okay, I found the answer. onAdd is called when an object is added to the scene, I think. onNewDataBlock is called when an object is assigned a new atablock. My problem was, I was adding a GameBase object. While GameBase defines scriptOnAdd and scriptOnNewDataBlock, it doesn't actually call them.