Okay Guys , this is my first post on this website.I am currently working on a project.
I have an Enemy class who chases my player when the player is within specified distance. When he gets within a certain distance his health decreases.However i want my player to get a bump effect when the enemy is attacking.So i used the bump function when they both collide.But i am not able to make it bump.Only the health gets deducted.
Here is my Code function in my Enemy class which extends UTPawn
Then i have Defined my Bump function as follows
However this does not seem to work. Kindly help with your inputs guys
Thank you
I have an Enemy class who chases my player when the player is within specified distance. When he gets within a certain distance his health decreases.However i want my player to get a bump effect when the enemy is attacking.So i used the bump function when they both collide.But i am not able to make it bump.Only the health gets deducted.
Here is my Code function in my Enemy class which extends UTPawn
Code:
simulated event Tick(float DeltaTime)
{
local UTPawn gv;
super.Tick(DeltaTime);
MyController.Tick(DeltaTime);
foreach CollidingActors(class'UTPawn', gv, 200)
foreach VisibleCollidingActors(class'UTPawn', gv, 100)
{
if(AttAcking && gv != none)
{
if(gv.Health > 0)
{
gv.Health -= 1;
Bump(self,CollisionComponent,vect(0,0,0));
}
}
}
}
Then i have Defined my Bump function as follows
Code:
event Bump(Actor other,PrimitiveComponent OtherComp, vector HitNormal)
{
TakeDamage(6,none,Location,vect(0,0,0),class'UTDmgType_LinkPlasma');
}
Thank you
Last edited by a moderator: