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"

How to get variables from level blueprint?

Hi there :)

I'm going to get some Variables and Structures From Level blueprint.

But I can't access by direct communication(Referencing)

and I dont know how to cating.(I already saw casting part of the unreal wiki, but I cant understand about casting /// bcause I'm a Desginer.)

So Could you tell me Two ways of accessing (Referencing and Casting) variables from Level blueprint. for Novice :)

Thank you :)

Product Version: UE 4.12
Tags:
more ▼

asked Jun 10 '16 at 11:21 PM in Blueprint Scripting

avatar image

ARRIETTY
14 4 2 5

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

2 answers: sort voted first

Hey :)

To my knowledge its not possible to cast to the level bp. An easy solution though is to store variables in the Character bp, since this is always accessible by using cast to character blueprint and using the 'get player character' node as the object reference (wildcard).

casting is basically a way of communicating between blueprints. You said you read the wiki, i would suggest to also have a look at the documentation. The example Epic provides should give a relative basic understanding of what casting does.

here's a link: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/CastNodes/

Good luck :)

more ▼

answered Jun 10 '16 at 11:53 PM

avatar image

obj
66 3 1 4

avatar image Nihilwolf Jun 11 '16 at 12:58 AM

Check out Game mode, Game Instance and Game States. Each can be casted to from just about any other blueprint.

I use game state to save some variables I want to have access to for other actors and such. Or for my saved game variables I save them using the game state.

To create a game state, right click in the content browser in the editor, like you would if you want to create an actor blueprint. Click blueprint class, and in the search box type game state. Change the name of the game state blueprint.

You can now use the game state blueprint to access variables for other actors. Like say for example a score. Keep track of the score in the game state. Should you want to access the scores variables with a HUD lets say, you can cast to the game state blueprint by right clicking in the HUDs event graph and look for "get game state". Then drag off of that to cast to the game state you created. Then drag off of that to get any variables out of the game state.

If you choose to go with a game mode, you can get game mode, then cast to game mode that you create. Do the same with game instance, get game instance, cast to game instance you created.

Anyways, casting can be a bit tricky. I get lost a lot when I'm trying to cast from an actor of some sort to some other actor.

Good Luck

~Nihil

avatar image phil123456789 Dec 13 '17 at 08:08 PM

gamestates are for network afaik

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

Thank you so much :)

more ▼

answered Jun 13 '16 at 08:17 AM

avatar image

ARRIETTY
14 4 2 5

(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