Game Development Community

%dstobject.getFrame() question (solved)

by rennie moffat · in Torque Game Builder · 12/17/2010 (10:26 pm) · 4 replies

Hi there,
can some explain to me how I can get the frame of a %dstObject on a collision?


I am currently trying this...
function MouseDraggableBehavior::onCollision(%srcObject, %dstObject, %srcRef, %dstRef, %time, %normal, %contacts, %points)
{
	if(%dstObject.class $= "thisClass")
	{
		%dstObjectFrame = %dstObject.getFrame;
		%srcObject.this();
	}
}


But I get the console message, unknown command and unable to find object.


:s

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
12/17/2010 (10:56 pm)
In fact, I am actually getting a position returned for %dstObjectFrame.


:S





#2
12/18/2010 (10:40 pm)
Try
%dstObjectFrame = %dstObject.frame;
#3
12/19/2010 (6:16 pm)
You forgot %this as your first argument of the callback.
#4
12/19/2010 (6:32 pm)
Oh, I should close this up.


Regardless of little errors, like that (not saying that is little) but thanks.


I realized my logic was completely faulty. I was asking to get the frame of %dstObject, when that was irrelevant. I need the frame of the third object. Not to mention dstObject had no frame, it is not a sprite.


Sorry.


But thanks.