Projectile as a grenade.
by Jackie Hayes · in Torque Game Engine · 06/11/2003 (6:14 am) · 18 replies
I have a strange problem. I have created a Grenade script that I use for throwing Grenades. I am using the projectile functions. I built the Grenade using Milkshape. Everything works great except that when I throw the Grenade it bounces corectly but when it stops it starts jittering and flipping around until it explodes. I am trying to figure out how to make it just sit there and NOT move around until it explodes. Anyone have a clue what might be going on?
Thanks.
Thanks.
#2
06/11/2003 (8:48 am)
Hmm.. I was looking around at the code and was wondering if I could do this with just useing ItemData instead of projectile or just create another class and call it Grenade. That way it would not have the overhead the projectile has. What do you think?
#3
06/13/2003 (1:04 pm)
dee, I didnt see any mass and density variables for projectiles, what are you referring to?
#4
Another thread suggested that Jackie Hayes had come up with a solution... Is that true?
Thanks in advance!
Stephane
11/22/2005 (2:23 pm)
Sorry to ressurect such an old thread, but has anyone been able to solve the projectile jittering issue? It seems to still be a problem in Torque 1.4.Another thread suggested that Jackie Hayes had come up with a solution... Is that true?
Thanks in advance!
Stephane
#5
Anyone have any luck with this? I have temporarily switched to using 'Items', but am still wondering if anyone has any suggestions...
Thanks!
Stephane
11/29/2005 (12:53 am)
*bump*Anyone have any luck with this? I have temporarily switched to using 'Items', but am still wondering if anyone has any suggestions...
Thanks!
Stephane
#6
11/29/2005 (3:42 am)
I'd like to know too, I use projectiles in my system.
#7
So overall what probably needs to happen if you want it to both bounce and then stay still is that the velocity vector length needs to be checked and then at some threshold it should be set to zero. My code has it "stick" and has a bunch of other crap, and is old, probably wouldnt be of much help overall. But I'm getting laid off, will have mo time for TGE/TSE, woot!
01/13/2006 (11:02 am)
Ok, I fixed this a long time ago, and from looking at my old code (way too different to post; multiple projectile types), the problem is that the velocity is never set to zero. It looks like its basically code from T2 for the pea-shooter where it expects to bouce around for a while and dissapear. Certainly not proper behavior for a grenade. It also will not explode until it hits the ground, the check for the projectile explosion timeout needs to be moved outside of the check for coll w/ the terrain. So overall what probably needs to happen if you want it to both bounce and then stay still is that the velocity vector length needs to be checked and then at some threshold it should be set to zero. My code has it "stick" and has a bunch of other crap, and is old, probably wouldnt be of much help overall. But I'm getting laid off, will have mo time for TGE/TSE, woot!
#8
01/13/2006 (11:49 am)
My grenades work totaly fine with stock projectiles(well... stock physics at least).
#9
01/27/2006 (3:21 pm)
They don't spin in place after bouncing a bit?
#11
01/31/2006 (1:33 pm)
Sounds great. :)
#12
Let me just fix up my code. And I'll post a resource.
02/01/2006 (2:25 pm)
Ok. Fixed the bouncing problem.Let me just fix up my code. And I'll post a resource.
#13
02/01/2006 (2:48 pm)
Awesome. Be sure to post the link to the resource, as it takes a while to be approved. :)
#14
Let's wait till it's approved.
02/01/2006 (2:49 pm)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9678Let's wait till it's approved.
#15
I added a call to a function in one of my classes. Let me add the code for that function and fix the resource.
I hope I fixed it.
02/01/2006 (6:01 pm)
Oppps...I added a call to a function in one of my classes. Let me add the code for that function and fix the resource.
I hope I fixed it.
#16
02/01/2006 (6:25 pm)
There's a problem; check the resource comments. :/
#17
02/02/2006 (12:07 pm)
I did. I don't have that, works fine for me.
#18
02/07/2006 (10:39 pm)
Oh cool. What other proj types do you have? I made ones that are "ground hugging" that are pretty cool- freebe for anyone who is interested. Follows terrain but not in a straight path; they are deflected some by hills, wont travel up steep slopes, etc.
Torque Owner Dee
Seems to happen more often with 'light' items.