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 handle the Begin Play events for actors added in the editor?

Hi, I have a few actor blueprints that I have added to the level in the editor. All of them have executable code running as part of Event Begin Play. And in one case, the actor is referencing another one of these actors. It is running smoothly as this point, but I don't think what I'm doing is safe practice.

What if the referenced actor [Let's call it Actor B] has not finished initializing in time? So should I fire off that begin play functionality as part of a custom event that is called when the first actor [Actor A] goes through it's begin play event to the completion?

Product Version: Not Selected
Tags:
more ▼

asked May 11 '15 at 11:32 AM in Blueprint Scripting

avatar image

Stormrage256
1k 82 75 117

avatar image Narghile May 11 '15 at 11:48 AM

You could put a half second delay in.

That would make sure they all exist before anything happens.

Narg

avatar image Stormrage256 May 11 '15 at 12:35 PM

Yes I suppose that should work in some cases, but it still doesn't guarantee that the other actors have finished storing a reference that I can use. The begin play code would still start running for all actors at the same time.

Do you know if there's any standard workflow that's used in the industry to handle stuff like this?

avatar image Narghile May 11 '15 at 12:38 PM

All depends on how you are referencing them.

Narg

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

1 answer: sort voted first

I got the answer from the Unreal forums. It seems it's better to spawn them as part of another script like level blueprint or game mode rather than just putting them in the editor. Here's the link to the forum post:

https://forums.unrealengine.com/showthread.php?69674-How-to-handle-the-Begin-Play-events-for-actors-added-in-the-editor&p=289642#post289642

more ▼

answered May 11 '15 at 05:11 PM

avatar image

Stormrage256
1k 82 75 117

(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