hi guys, so i have a blueprint in which when i press E , and when I’m looking at a certain door, it will spawn a Monster in the room using spawn actor, in another blueprint , i want to check if the user then looks at the monster for a second or 2 , it will trigger a matinee , but i don’t know how to reference the spawned monster in other blueprint , i made a variable for spawned monster in door blueprint and i called it in looking trigger but it didn’t work , tried casting it, didn’t work, any idea what should i do?
there are several ways to do that. One is storing the grim reaper actor in a place where you can access for example your gamemode. then you can get your gamemode, cast it to your gamemode class and then get the variable with the monster reference:
trace line for example will evaluate a line from a start point to an end point and if the line hits some actor it will give you a lot of information about that hit.
To make it working just be sure to turn ‘generate hit events’ ON and Block on collisions.
You want to use the level blueprint to pass the spawn actor to the TriggerLook blueprint.
Or you can use event dispatcher to pass the spawned actor from the Door to the Trigger.