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"

Adding actors and components to a custom ALevelScriptActor

I'm trying to add default actors and components to my custom ALevelScriptActor based levels, my code compiles with no problems, but does nothing. I'm new with Unreal's API, is there a better/correct way to do so?

alt text

PS: The intellisense error is caused by this know issue UE-62042

Product Version: UE 4.20
capturar.png (14.7 kB)
more ▼

asked Jul 28 '18 at 12:15 AM in C++ Programming

avatar image

190 2 7 6

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Do that on AGameMode, level script is to contain level specific code (via Level Blueprint) and only reason why you want to add C++ code is only if you want to send data to it like event and such. Probably Level Blueprint processing mess with component.

I personally used AGameMode multiple time to add post processing screen effects using post processing component and i can confirm you it works well :)

Absolut alternative is to make a actor with those components, spawn it in C++ and just control it

Also as extra if you want to add level specific properties, there AWorldSettings if you don't know yet ;]

more ▼

answered Jul 28 '18 at 01:25 AM

avatar image

35.7k 925 168 1101

avatar image BrunoCaxito Jul 28 '18 at 03:04 PM

Thank-you for the answer. Althought your solution seems to work, I've decided to use Level Streaming to solve my problem.

The persistent level has all the common actors and behaviors for all levels (sky, fog, sicles, etc.), the ALevelScriptActor sets the streamed levels common behavior

PS: Sorry for the bad english.

(comments are locked)
10|2000 characters needed characters left
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