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. 

Cast To ... (Other UMG BluePrint)

Hi guys, "Cast To ..." I have a problem with the function, if I call a simple function (without the class) it gives me an error when compiling, if I use the function to obtain the Class ( Cast To ... class ) that when testing UMG just flies all the time gives a warning ...

alt Thirst Screenshot alt Second Screenshot alt Third Screenshot

P.S I do not understand English very well ...

Product Version: UE 4.12
Tags:
more ▼

asked Jun 14 '16 at 11:00 PM in Blueprint Scripting

avatar image

McFree
3 2 3

avatar image Nick Jackson Jun 15 '16 at 11:47 AM

How does SelectLevelMenu know which level the player selected? Can you show us that code? I don't see why you would need to cast here at all.

avatar image McFree Jun 15 '16 at 12:38 PM

alt text

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

2 answers: sort voted first

You need to provide the object to Cast to SelectLevelMenu. You will need to get a reference to the blueprint you want to cast first, because you're spawning it in that script itself you can simply store the result of Create Select Level Menu Widget as a variable, and provide that to Cast to SelectLevelMenu

However, in this case because it is already a SelectLevelMenu there is no need to cast it.

Think of "Cast" as a way to interpret an object as something else. It's not a way to retrieve an object.

more ▼

answered Jun 14 '16 at 11:20 PM

avatar image

Vaei
596 28 24 52

avatar image Vaei Jun 15 '16 at 11:53 AM

You don't need to cast an object into itself, that's why you're getting the warning, just remove the cast node altogether - you already have a SelectLevelMenu as a result of having just spawned it in the same blueprint and execution chain. If you're getting a crash you should post the crash log in a separate question (it's unrelated).

Ah also, make sure you reply to an answer rather than replying with an answer. It will make it easier for people to help you :)

avatar image McFree Jun 15 '16 at 01:07 PM

Thank you =) I did as I understand what you said and I now always selects a default value that I put in SelectLevelMenu, turned out is such a chain of actions: alt text

avatar image Vaei Jun 15 '16 at 01:10 PM

Glad you got it sorted! Don't forget to mark the correct answer to help others who come here from Google.

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

I tried as you said, it turns out here such: alt text

All the same, a warning appears and crashes at startup for testing ...

more ▼

answered Jun 15 '16 at 09:49 AM

avatar image

McFree
3 2 3

(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