Game Development Community

Unable to find object

by Scott Coursey · in Torque Game Builder · 09/08/2006 (8:18 pm) · 1 replies

Here's what I have...

My t2dSceneWindow is named sceneWindow2D (for lack of a better name). I've added some vars to it and they work just fine. I also have a t2dSceneObject called MoveGrid of class ydsGridMap.

Now, I can echo the value of the MoveGrid and always get a good value:

echo(sceneWindow2D.MoveGrid);

No problem.

Here's the problem...

Somewhere else in the code, I need to access the MoveGrid and call a function within ydsGridMap that does its own thing. In the EA version of TGB, I could easily call:

sceneWindow2D.MoveGrid.ShowAround(%this);

and everything would work just fine. Some of the internals of TGB have changed since I last worked on the game (last year, actually) and I'm now getting the following error:

raiders/scripts/ydsRaidersUnit.cs (332): Unable to find object: '2722' attempting to call function 'ShowAround'

Line 332 reads as:

sceneWindow2D.MoveGrid.ShowAround ( %this );

Hm. Odd. Any clues? And no, the MoveGrid has not been deleted (that I know of, anyway).

#1
09/08/2006 (8:49 pm)
Actually, I figured it out. I created the MoveGrid before I called a LoadLevel for the sceneWindow2D. After the LoadLevel, the Grid is gone. I changed the order of execution and now the Grid is present.