Where are spawner objects in the code?
by John Bura · in Torque X 2D · 06/01/2010 (11:06 am) · 3 replies
Hi there,
I would like to turn on an off spawner objects at certain points in the game. How do you turn on an off a spawner object?
Thanks :)
I would like to turn on an off spawner objects at certain points in the game. How do you turn on an off a spawner object?
Thanks :)
Torque 3D Owner Henry Shilling
Smokin Skull
or name the spawner in the editor when you create it, then use (this assumes you named your spawner "MySpawner")
T2DSpawnObject theSpawner = TorqueObjectDatabase.Instance.FindObject<T2DSpawnObject>("MySpawner"); if(theSpawner != null) { theSpawner.SpawnEnabled = false; // or whatever else you want to do // like theSpawner.MarkForDelete = true; }if you look at the code in T2D/T2DSpawnObject.cs there are other things you can do there as well, like fire a spawn manually.