Unmount weapon
by Jeremy Jenkins · in Torque Game Engine · 06/08/2007 (2:15 pm) · 6 replies
For my game I need the player to be able to throw a ball. At first I used throw(), but I decide that a normal projectile fits the game better. I use the same model for the projectile as the weapon, so it basically looks like he is throwing instead of shooting. My problem is that the weapon unmounts a couple of seconds after I shoot the projectile and ruins the illusion. I tried to play the throw animation before I unmounted the ball so I used a statescript for when the weapon was out of ammo. If anyone knows a better way to do this or has any suggestions, I would truly appreciate it.
Thanks in advance.
Thanks in advance.
About the author
#2
Watch this video, towards the end you will see my method in action, when the player throws C4 packs, grenades and some land mines. Looks damn convincing in my opinion.
Download Video Here (93 MB)
06/08/2007 (7:57 pm)
I do something like this for throwing grenades, med packs and C4 packs etc. I just spawn an item for the object that is thrown and have created a throw animation for the mounted image - when the throw anim has reached the end point I spawn the item and use a visibility animation to "hide" the image.Watch this video, towards the end you will see my method in action, when the player throws C4 packs, grenades and some land mines. Looks damn convincing in my opinion.
Download Video Here (93 MB)
#3
I think I understand how I could do this now.
The only thing I don't get is what you mean by use a visibility animation to "hide" the image.
Are you saying an animation on the player or weapon?
Also do you mean to move the weapon out of the camera's view?(because that might not work for my game since I would like 1st/3rd person point of views)
Thanks again
06/09/2007 (10:19 am)
Thanks for the response Tim, the video was really nice. (The C4 and mines looked pretty real)I think I understand how I could do this now.
The only thing I don't get is what you mean by use a visibility animation to "hide" the image.
Are you saying an animation on the player or weapon?
Also do you mean to move the weapon out of the camera's view?(because that might not work for my game since I would like 1st/3rd person point of views)
Thanks again
#4
Thanks in advance.
06/09/2007 (2:47 pm)
I forgot to add this last time, but does anyone know how to change the timing in the state system so the shot is fired after the animation?(doesn't have to be the state system i guess, just seems like the right thing to change for this)Thanks in advance.
#5
06/09/2007 (8:50 pm)
I mean the weapon image. So in the weapon animation, two hands throw out a mine and when the animation reaches the end of the throw I hide the mine - then in code I spawn a mine that is thrown and takes its place.
#6
06/10/2007 (1:15 pm)
Oh, I get it. Thats a really good idea. I might change to something similar, but right now you can't see the player's hands in first person. You just see the top of the ball. (Which is what I originally wanted) Oh well, I guess its back to blender. Thanks Tim, you've been a big help.
Torque Owner Jeremy Jenkins