Game Development Community

OnUpdateScene question

by Brian Wilmeth · in Torque Game Builder · 02/26/2006 (8:03 am) · 1 replies

I set up a camera system as shown in the platformer tutorial on TDN. My onUpdateScene function looks like this.

function t2dSceneGraph::onUpdateScene(%this)
{
if (%this != t2dscene.getID())
return;
$camera.update();
}

When I run torque2D, I get this annoying warning that clogs my console log.

unable to find object: 't2dScene' attempting to call function 'getID'

Its more difficult to check for errors in my script when this annoying message pops up over and over. Any way to get rid of it?

Thanks :)

#1
02/26/2006 (11:20 am)
There's an easy way to get rid of it; don't make the call on an object that doesn't exist, especially in a function that's called each frame! :)

- Melv.