im trying to control how much damage a vehicle gets on how fast its going i.e : if the vehicle is going let say 100 mph it destroys the vehicle but if its going at only 10 mph it only does small amount of damage. can anyone help me on this?
Announcement
Collapse
No announcement yet.
Vehicle Impact Damage Pls help
Collapse
X
-
i've worked out this code don't know if it works the way i want:
Code:simulated function VehicleCollision(Vector HitNormal, Actor Other) { local int Damage; local Pawn Inst; Inst = Pawn(Other); if (( Other != instigator ) && (VSize(Velocity)>=100)) { Damage = VSize(Velocity)/10; if (Damage < 0) // Hack to stop damage from healing our ship { Damage = 0; } } else if (( Other != instigator ) && (VSize(Velocity)<100)) { log("VSize(Velocity) is : "$VSize(Velocity)); Damage = 0; } log("Dishing out Damage : "$Damage$" and Velocity is : "$VSize(Velocity)); TakeDamage(Damage, Inst, Location, vect(0,0,0), None); }
Comment