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"

Accessing actor in sub level

I'm creating an endless runner type game where the persistent level BP loads sub levels using the following function:

alt text

This function works as expected, but I need to be able to access a particular actor inside the level that was loaded to determine where the next level should be loaded. The Load Level Instance node returns a Level Streaming Kismet reference, but there's very little I can do with it. I've tried using an interface but the function doesn't actually run.

Is there a way I can do this?

Product Version: UE 4.14
loadlevelatbp.png (235.4 kB)
more ▼

asked Dec 12 '16 at 08:26 PM in Blueprint Scripting

avatar image

20 2 4 6

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

1 answer: sort voted first

Given your use case (knowing where to spawn the next sub-level instance), instead of trying to access an actor inside your sub-level, I would just have your sub-level tell a central location (like GameInstance) where the next level should be spawned:

1) Create a NextLevelLocation Transform variable in your Game Instance or Game Mode

2) On the Begin Play of all your sub-levels, get the transform of that actor you're talking about and save it into the NextLevelLocation variable.

3) When you load a new sub-level instance, just pull the location from the NextLevelLocation variable.

more ▼

answered Dec 12 '16 at 08:58 PM

avatar image

1.2k 63 33 96

avatar image thesonglessbird Dec 13 '16 at 01:46 PM

Thanks for the help, works perfectly!

(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