Announcement

Collapse
No announcement yet.

NPC's Destroyed When It Touches Anything

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NPC's Destroyed When It Touches Anything

    Howdy there!

    I'm kind of stuff on using the Event Hit nodes the correct way.

    The goal is to have a "Horde" style game in which lots of NPCs chase you around and try to kill you and for the project I am using the FPS Template. I'm trying to destroy the NPCs when the projectile collides with said NPC. The problem is when I use any type of 'Hit' events. I keep getting stuck in a loop of <If NPC character collides with event generating meshes, then destroy actor(self)> I tried multiple ways to get it going but I end up in that same loop because I ended up using the same setup: Event Type-->Destroy Actor

    HOWEVER, below in the snapshot is what I'm currently exploring. Would someone mind letting me know if I'm on the right track and correct thinking?

    Thanks everyone!

    Attached Files
    Last edited by BananaKing932; 02-17-2015, 07:18 AM. Reason: Adding snapshot I meant to include when I first posted.
    VR Virtual Keyboard Marketplace Asset: https://www.unrealengine.com/marketp...rtual-keyboard

    #2
    Just to confirm ... if the NPC hits the character it must be destroyed?

    If this is case then why not just put a trigger sphere around your character and apply an on overlap event to the NPC. When it overlaps you can then do anything - apply damage, destroy NPC, spawn emitter.

    This is probably how I would tackle this. Not sure if this is what you need.
    Quinton Delpeche
    Founder - Gobbo Games | Designer - The Colony 2174 (Board Game) | Developer - Riders of Asgard

    Comment


      #3
      Hello,
      From your event hit, use the " other " output and cast it to the actor you want destroy your npc (can be bullet and knife or player for example) on exec output, set your destroy actor then all other hit will be ignored.

      Comment


        #4
        Originally posted by qdelpeche View Post
        Just to confirm ... if the NPC hits the character it must be destroyed?

        If this is case then why not just put a trigger sphere around your character and apply an on overlap event to the NPC. When it overlaps you can then do anything - apply damage, destroy NPC, spawn emitter.

        This is probably how I would tackle this. Not sure if this is what you need.
        I was trying to get the projectile (in the FPS template that orange/yellow ball) to destroy the NPC. And what you said was what I was looking for but I knew there was a different way rather than just load the NPC blueprint up with Triggers. I like knowing multiple ways to do this haha
        Thank you for your response though because you helped me start the idea for how the player character will be taking damage

        Originally posted by Fen View Post
        Hello,
        From your event hit, use the " other " output and cast it to the actor you want destroy your npc (can be bullet and knife or player for example) on exec output, set your destroy actor then all other hit will be ignored.
        Works perfectly I tried using what you suggested before but for whatever reason I kept wanting to connect the 'As My Projectile' pin to the Target pin on the 'Destroy Actor' node which made it not work, haha.
        Thank you for the help

        Attached Files
        VR Virtual Keyboard Marketplace Asset: https://www.unrealengine.com/marketp...rtual-keyboard

        Comment

        Working...
        X