I am trying to make a door open, but only when you’re looking at it and when you’re close enough. I’ve tried a few different things, but I don’t really know what I’m doing as I’m really green to unreal, and when I asked my teacher he went way to fast and I didn’t really understand anything.
The code in the second image is supposed to shoot a line trace in the direction of the camera and when it hits the door it sets the variable ODCanInteract, which allows you to open the door. You need a branch node, and when display name = “the doors name”, set ODCanInteract to True. Hook up a print string node to stuff that you don’t understand.
So what @jay001020 here said is accurate, however the display name tracking is not something most do anymore. Because depending on the actor itself, that display name can be different. Most get a letter and a number after the spawn to differentiate identical actors.
Usually, this is done through tags these days.
You can add a “Tag” to anything. Typically one would add an “Interactable” tag to the door, then off of hit actor use “Actor has Tag → Interactable” then a branch, off “TRUE” set “ODCanInteract”.
You can add a tag to something by opening the actor, selecting the root, and in the “Details” window, it’s at the very bottom by default or you can search tag, and hit the “+” to type it in