Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 youalt text

Product Version: UE 4.18
more ▼

asked May 10 '18 at 02:14 PM in Blueprint Scripting

avatar image

62 3 4 4

avatar image ThompsonN13 May 10 '18 at 03:19 PM

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.

avatar image kingace3 May 10 '18 at 05:36 PM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered May 10 '18 at 03:47 PM

avatar image

503 2 9 7

avatar image kingace3 May 10 '18 at 05:39 PM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question