Game Development Community

Can't set TargetObject on Spawn Points

by Daniel Swinney · in TGB Platformer Kit · 01/02/2009 (11:58 pm) · 4 replies

About the author

Recent Threads


#1
01/02/2009 (11:58 pm)
It turns out that you have to add a couple lines of code after each datablock template in 'datablocks.cs,' which is located in the 'gameScripts' folder. So, here's what you would put after the DragonTemplate datablock:

if (isObject(DragonTemplate)) DragonTemplate.safeDelete();
$managedDatablockSet.add(DragonTemplate);

For more info, check out this forum post:


http://www.garagegames.com/mg/forums/result.thread.php?qt=73415
#2
01/03/2009 (12:02 am)
Actually, I just realized that it gives you an error when you call the safeDelete() function, so I'm just going to comment that out for now, unless anyone has any suggestions to fix this.
#3
01/03/2009 (1:24 am)
Changing them to .delete() should fix the issue.
#4
01/28/2009 (12:10 pm)
I'm having problems with this.

I'm following the Demo Level tutorial. I create the player and it works, so up to this point, everything is done as said. But when I try to create the spawn point my only option for TargetObject is "none".

If I add those lines of script, I can select "DragonTemplate". But when running the game, there's no Dragon.

I've done it with .safeDelete() as with just .delete() "DragonTemplate" doesn't show.