The call() method
by Rob Stiles · in Torque Game Builder · 08/24/2009 (1:24 pm) · 3 replies
Hi,
Can someone please explain why the following works
%this.object.jump();
but the following doesn't work?
%this.object.call("jump");
I can't seem to find any documentation on call().
Thanks,
Rob.
Can someone please explain why the following works
%this.object.jump();
but the following doesn't work?
%this.object.call("jump");
I can't seem to find any documentation on call().
Thanks,
Rob.
About the author
#2
08/24/2009 (5:35 pm)
Thanks for your reply :) I was actually modifying that file to allow me to call methods in other objects. Eventually I gave up on call() and used schedule() instead which worked without a hitch. I don't know if that's bad form or not though because I'm new to Torque.
#3
08/24/2009 (6:17 pm)
I've got dozens of games where I use %obj.schedule(0,...) to call a function (before I learned about the "call()" function itself). I wouldn't sweat it.
Associate William Lee Sims
Machine Code Games
Since you have TGB, you mgiht try using the button behavior and making sure that works. It has a %this.owner.call(...) in it.