Game Development Community

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

#1
02/24/2006 (6:41 am)
Take a look at the Demo[walkthru] GUI and the ANIMATION SCENES....in there is a gui that plays 3 actionThreads...;), and mounts some objects...:). I must say that is a great setup, with the controls directing the action inside the 'picture' frame, very nice. Good luck!

...oh, and I think one for changing detail levels.
#2
02/24/2006 (8:49 am)
Sorry for the off topic, you're from Northeastern in Chicago?