Game Development Community

Multiple Weapon Firing modes

by Walter Gray · in Torque Game Engine · 07/13/2006 (5:42 pm) · 1 replies

I'm having trouble constructing a weapon that fires seperately with the right and left mouse buttons.

It seems most resources on multiple weapon firing modes seem to involve mounting and unmounting images. This isn't syncing up very well with the actual release of the projectiles.

I was thinking of adding more states to the weapon image, but I still don't quite understand how it works, and there seems to be some strange hardcoded stuff.

About the author

Recent Threads


#1
07/13/2006 (8:27 pm)
The simplest way to do this is something like adding a commandToServer when you fire that sends the key you pressed, and then make a conditional in your weapon's onFire that checks which key was used to fire. So both keys do the same thing as far as making the weapon fire, but with a different variable passed in so you know which one fired it.