Blueprint Casting

So I have an Actor blueprint set up with a basic inspection system. This blueprint is used for notes found around in my game. Whenever you interact with the note it creates a widget that displays what the note says and allows you to use the mouse to click on an icon to close out of it.

What i’m trying to create is that a certain note that you pick up will do something different when you try to close out of the widget menu. I’m trying to cast from My note BP to my Examine widget. I would say my skill level is intermediate when it comes to blueprint scripting. I know that when casting you are talking to the MAIN BP not a specific one, so i’m having trouble on how to tell the engine what BP i’m talking about exactly. I could use the Get All Actors Of Class node but i know its a slow operation and i’m trying to avoid that since there are many notes in my level.

I’m stuck on how i can plug in the BP i want to talk to in the object pin.

Thank you

how are you interacting with the note? if its and overlap event then you can just use the other actor pin. if its another way then there is another way to get the reference. basically you want on interact with note item set a variable to the value of the note item then you can use that variable as the reference later on down the script.

Hi there. Are the all the notes spawned on BeginPlay?
If so you could do a Get All Actors of Class when you spawn the Player Character - yes it can be an expensive operation but you’d only do it once and then store all the returned actors in an array variable you can then use cheaply.

Such an easy fix lol. I’m using a line trace to determine which type of object the player is interacting with, so i can just add to that script to set a reference to the actor.

Thanks a bunch!

Some of them are spawned throughout the level but i realized that i’m doing a line trace already to determine what type of object the player is interacting with. So i’m going to just set up further variables to reference back to my object.

Thank you for the help!