Ok so here is my current issue, it's also the last issue stopping me from having a completed framework (as far as i can tell)
So i currently have two pawn classes. the player and the enemy NPC
The enemy NPC's run around and try to bump into you to deal damage. this code works fine
when they hit the player the player gets hurt/dies
I want the player to essentially "crash bandicoot" it up and spin into them to deal damage to them
here is my current code for that
this works and spawns the particle effect and hurt radius but the HurtRadius ends up killing the player, not the NPC, but theres no way to call bump or touch as a function (to my understanding at least) so i'm at a bit of a loss as to how to deal damage to these NPC's in the playerpawn class without having to go through the whole "it's actually a really short range projectile weapon" business.
so yeah any help in getting it so that when the tracing detects it's hit something to deal damage to that something would be great. i'm really at a loss as to go about doing it.
any ideas/directions to go in/help is really appreciated
So i currently have two pawn classes. the player and the enemy NPC
The enemy NPC's run around and try to bump into you to deal damage. this code works fine
Code:
event Bump(Actor Other, PrimitiveComponent OtherComp, Object.Vector HitNormal) { local Pawn HitPawn; HitPawn = Pawn(Other); if(HitPawn != None) { if( PlayerController(HitPawn.Controller) != None ) { HitPawn.TakeDamage( 50, None, HitPawn.Location, vect(0,0,0) , class'UTDmgType_Lava'); } } }
I want the player to essentially "crash bandicoot" it up and spin into them to deal damage to them
here is my current code for that
Code:
exec function Attack () { `log("attacked"); AttackAnim.PlayCustomAnim('AttackTest',1.0,0.2,0.2, false, true); attackcheck(); } //the hit detection function attackcheck () { local vector loc,norm, end; local TraceHitInfo hitInfo; local Actor traceHit; end = Location + normal(vector(Rotation))*564; //trace to "infinity" traceHit = trace (loc, norm,end, Location, true,,hitInfo); `log("tracing"); if (traceHit==none) { `log("nothing to hit"); return; } else { `log("Hit"); HitEffect(); } } function HitEffect() { //the particle effect HitEmitter = Spawn(Class'EmitterSpawnable'); HitEmitter.SetTemplate(ParticleSystem'FX_VehicleExplosions.Effects.P_FX_VehicleDeathExplosion',true); HurtRadius(500, 300, class'UTDamageType',1000.0, Location,,,True); }
so yeah any help in getting it so that when the tracing detects it's hit something to deal damage to that something would be great. i'm really at a loss as to go about doing it.
any ideas/directions to go in/help is really appreciated
Comment