RadiusDamage not using impulse
by Ronald J Nelson · in Torque Game Engine · 06/29/2007 (12:47 am) · 2 replies
For some wierd reason I use radiusDamage for an explosion from a grenade and while it does apply damage just fine, it doesn't apply the impulse. I am just using the standard radiusDamage function.
I did try adding some echo statements to the portion that involved the impulse and this is the data I got. By the way I threw the grenade under the buggy.
This is %targetObject : 2517
This is %targetObject.getDataBlock().shapefile : main/data/shapes/items/tnt.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -251.404 -126.917 413.145
This is %targetObject : 2313
This is %targetObject.getDataBlock().shapefile : main/data/shapes/vehicles/buggy/buggy.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -368.986 162.897 295.489
As you can see it is definitely detecting the grenade and the vehicle, but they don't move.
I did try adding some echo statements to the portion that involved the impulse and this is the data I got. By the way I threw the grenade under the buggy.
This is %targetObject : 2517
This is %targetObject.getDataBlock().shapefile : main/data/shapes/items/tnt.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -251.404 -126.917 413.145
This is %targetObject : 2313
This is %targetObject.getDataBlock().shapefile : main/data/shapes/vehicles/buggy/buggy.dts
This is %position : 312.242 394.634 225.003
This is %impulseVec : -368.986 162.897 295.489
As you can see it is definitely detecting the grenade and the vehicle, but they don't move.
Torque Owner Tim Heldna
function handGrenadeThrown::onDestroyed(%this, %obj, %lastState) { %damage = 50; %radius = 10; %impulse = 100; %dmgType = "hand grenade"; radiusDamage(%obj, %obj.getPosition(), %radius, %damage, %dmgType, %impulse); %obj.schedule(500, "delete"); }