Download

Event ActorOnClick for a Character?

I am trying to have it so once I click on a AI Character they will be destroyed. I am planning on adding different functionality once I get this far (have the player selectable and move where I click next). However, whenever I try to use the method in the image it does not work. It does however work if I create a basic cube using the blueprint actor class instead of character class. Is there a specific setting I need to tic to enable this?

Not sure if the information helps, but The AI Character will be using a behavior tree to walk around in the future, but focus on a specific task (in this case to destroy itself) if clicked. It will not be a RTS however.

Also, the point of using the on click is that I should be able to click on the Character from any distance

Much easier if you put an ‘onclicked’ for the mesh, because that’s what people will be clicking anyway:

Screenshot_3.jpg

You also need:

@ClockworkOcean Hate to ask, but can you make a quick video from start to finish with a fresh project. You dont have to explain what you are doing or anything, just run through it. I tried this for a few days and updated to the preview unreal engine but still can not delete an AI Character using this method

What’s your base project type? ( FP, TP, Top down etc )

The project type is the TopDown template

This is all I did:

  1. New project

  2. Put this in character:

Screenshot_1.jpg

  1. Set the character mesh to block all

  2. Enable input

Mouse click uses a linetrace to get the result, make sure the component you want to click on blocks the visibility channel.

Ah, okay, so I needed to set it to block all.

What is the point of changing auto receive input to player 0 though? it destroys the actor without that