Damage script hurts me...

I tried attaching the damagereciver script from the FPS tutorial to my First Person Controller… it works great as far as the enemy can hurt me… but for some reason everytime I fire my weapon I get hurt too…

my projectiles are not exploding on me, and they hurt the enemy just fine…so it doesn’t seem like they are colliding with me just seems that for some reason my ammo hurts me…

any ideas on why this would be happening?

Turn the gun around so it’s pointing away from you?*

  • always a good tip when handling firearms :slight_smile:

LOL I actually went and looked at it…:stuck_out_tongue:

then I was thinking, “wait if it was backward the ammo would be flying out the back of my character…LOL”

and they are definitely going in the right direction…LOL

it might depends on where the projectile is starting, could it first hits your character’s collusion then hits the other person? So it hurts you, too.

If that’s not the case, you can probably just tell it to ingore your main character.

I double checked it and in the FPS tutorial ignore collision is already in the script.

I did notice I had the damagereciever script on the First person controller and should have had the character damage script on it so I fixed that, also I fixed the enemy so he has the damagereciever script on him.

now here is what happens he fires his weapon and kills himself, I have checked that the projectile is set in front of him, the weapon is in front of him.

now when he shoots me though doesn’t take my hp down with the character damage script on me, it did with the damagereciever script.

also now that I have the character damage script on me I no longer hurt myself with my weapon, but he doesn’t hurt me now either???

so anyone that has done the tutorial have you run across this so you can give me a tip as to what I might be doing wrong…?

If you need i can post the scripts I just figured it was redundant as they are the exact scripts from the FPS tutorial…:stuck_out_tongue:

well it took an entire day but I figured it out… I forgot to drag my projectile with the box collider around it to the prefab I had made…so basically when I shot it was using a proj without a collider, so didn’t have anything on it to tell it to ignore…LOL