Game Development Community

Find Ball

by rennie moffat · in Torque Game Builder · 02/15/2011 (8:52 am) · 2 replies

Hi there,
I have a question regarding safeDelete() and separate behaviors.



I have a behavior (behavior1) create an object, %this.ball (and or $ball). ball is mounted on Guy. In behavior2 owned by Guy I have created a behavior field for ball. Under certain circumstances, ball. must be safeDeleted(). The conditions are met but I get this message....

game/scripts/behaviors/ChipManagerBehavior.cs (199): Unable to find object: '' attempting to call function 'safeDelete'



How can I get behavior2 to find ball?






About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
02/15/2011 (9:40 am)
To get behavior2 to find ball, use your global variable "$ball". Every behavior and function will be able to see that.
#2
02/15/2011 (9:44 am)
So if I set a new t2dSceneObject to $ball. when I call $ball.safeDelete(), it should? (for good reference, I found another way around), thanks.