Sorry the title is phrased a bit weird, the character limit hindered me a bit.
I’m getting started with doing my own thing in BP and to test something I’ve made a cube actor which I can switch the material for. I tested it with an input key so I know that part works. Now I want to change the material when I look at (point the camera at) the object, then switch it back when I look away.
I set up a trace on the player camera, collected the hit actor from the output, cast it to my BP class and called the “looked at” function.
First question, how do I get the option to pick a custom event in here? I was able to make a copy of the “looked at” function in the level BP and copied it, but couldn’t make on in another actor’s BP in the same way? I figure it must be possible since I could cheat like that, but it seems odd it wasn’t just the same.
Anyway, I have it now that when the camera points at the actor the first time the material changes, permanently. So now I want a way to trigger the actor’s BP event to switch the material back. How should I be doing that? It seems tricky from the character BP as the trace will no longer be referencing the actor since we’re looking at something else, and I don’t think I can trigger anything off of “cast failed” since it’s possible to go straight from looking at one instance of the actor to another. I figure I can fix it that in the box class the “not looked at” event can be triggered when the “looked at” one is not.
Graph is getting a bit messy whilst I try to sort this, so advice would be appreciated.