How to dedect looking at actor

Hi.

there is great tutorial by looman here which is what you exactly need

hi i want to make someting that is knowing when is been looking at i want like to make an blueprint actor that when i look at him with my first person charctor it tells me like when you pick someting up you look press do someting and then it puts it in inventory so how can i dedect it ?

thx but is there a simpler tutorial i use it for single player

if you wanna implement a simple pick up system there are two options

1- using overlapping: add a sphere/box collision around your character and say if a key is pressed get all overlapping actors which gives you an array of all actors inside that collision then cast them to your pick up actor class if cast succeeds you can add them to your inventory.

2- ray tracing. which traces a ray toward your camera direction and gives you the hit actor.

why don’t you google for it?

google this: UE4 simple pickup system :))

this is still dosent help me i need it to be like the tutorial you gave me but simpler is this possible ?

I am sorry . there is no simpler method to do that.

get your feet wet and try one of those hard tutorials.

there is a simpler tutorial here

If you are looking for a very simple method, make a custom Player Character and a custom NPC Character

Give the NPC Character a boolean variable named “bLookedAt”

Inside the Player Character create a variable of the same type as the NPC Character and name it “LookedAtCharacter”

Fire a line trance from Camera->WorldLocation to the Camera->WorldLocation+((Camera->Forward Vector) * (10000))

Break the “Hit Output”

Get a reference to the “LookedAtCharacter” Check if it “IsValid”. If it is then set it’s “LookedAt” variable to false.

After that and if it is not valid, continue both paths to the next step.

Cast the “Hit Output” “Hit Actor” to the NPC Character.

If the cast is successful then set the NPC Character “bLookedAt” variable to true and set the “LookedAtCharacter” in the Player Character to the cast NPC Character.

Let me know if this works or if you have any more questions.