x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Setting instance of Public Variable in Widget Blueprint Broken?

I set up an easy scenario which can be understood immediately. When a button is clicked in the Widget blueprint, it will call the custom event “Say Hello” from the BP_MainGame Blueprint, and then a print string node will run.
(Pic 1 & 2)

In order to call the custom event from my BP_MainGame blueprint, I have set up a public object reference variable. (Pic 3) The type has been set as the BP_MainGame blueprint.

From there, when I want to select the instance of my public variable in the details panel, it gives me the option to select it, yet is never set. (Pic 4 & 5) No matter what I try I can’t set the instance of the variable.

Is this a bug? Am I doing something wrong? Please help~

-Thanks-

alt text

alt text

alt text

alt text

alt text

Product Version: Not Selected
Tags:
1.jpg (120.2 kB)
2.jpg (109.9 kB)
3.jpg (91.1 kB)
44.jpg (74.1 kB)
5.jpg (36.4 kB)
more ▼

asked Nov 05 '14 at 08:51 AM in Blueprint Scripting

avatar image

BrannenK
3 2 2 4

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

1 answer: sort voted first

Hello BrannenK,

Could you tell me what it is exactly that you are trying to do? If you are simply trying to communicate between the widget and let's say the MyCharacter blueprint you will need to cast. Here is an example of how to get the set up you have working.

This will be placed in your character blueprint

alt text

This will be placed in your widget blueprint. To get the "cast to" node to appear you will need to get the player pawn in this case and drag off that pin. If you would like to cast to your player controller you will need to get player controller and so on.

alt text

Is this the effect that you are trying to accomplish? I hope this helps.

Make it a great day

casthelp2.png (23.1 kB)
casthelp.png (72.5 kB)
more ▼

answered Nov 06 '14 at 02:46 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 523

avatar image BrannenK Nov 06 '14 at 08:50 PM

Thank you so much for your reply. The main thing I am trying to do is communicate between a Widget and a Class Blueprint.

While casting to MyCharacter may work, the problem I am having is casting to a Class Blueprint. That led me to try and make an object reference variable for the blueprint (as documented in this post.)

How would I go about casting to a Class Blueprint from within the widget? Or was my previous method of attempting an object reference variable the better route to go?

avatar image Rudy Q ♦♦ STAFF Nov 06 '14 at 09:22 PM

Hello BrannenK,

I will need to know what type of class you are trying to communicate with. Some examples of blueprint classes are:

  • Player Controller

  • Pawn

  • Character

  • Game Mode

  • Actor

To show how this may be different I have included the following example of casting to an Actor class. You can compare this with the first example of casting to a Character class. Once I know what type of class you are referring to I will be able to assist you further.

alt text

(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