Using GUI buttons to play animations
by Northeastern University (#0001) · in Torque Game Engine · 02/24/2006 (6:31 am) · 2 replies
Currently I'm trying to create a GUI button that, when a user clicks on it, the player character will immediately start attacking something (i.e., play its attack animation).
I've looked at the Command field, and have tried many things, like
Command = "$globalPlayer.playThread(0, \"attack\");";
but that crashes Torque. (I've declared $globalPlayer in my player.cs file as my player character.)
I've also tried making a playAttackAnimation() in my player.cs file and my .gui file, and having the Command field call it, but the console.log says the function is never found.
Could anyone give a hint as to how to make a GUI button play an animation?
Thanks! :)
-Karen
I've looked at the Command field, and have tried many things, like
Command = "$globalPlayer.playThread(0, \"attack\");";
but that crashes Torque. (I've declared $globalPlayer in my player.cs file as my player character.)
I've also tried making a playAttackAnimation() in my player.cs file and my .gui file, and having the Command field call it, but the console.log says the function is never found.
Could anyone give a hint as to how to make a GUI button play an animation?
Thanks! :)
-Karen
Torque Owner Rex
BrokeAss Games
...oh, and I think one for changing detail levels.