[4.9P2] Object was exist without a ConstructionScript calling

№ 5
Title: [4.9P2] Object was exist without a ConstructionScript calling.

Importance: Medium.

Branch: Binary

Build version:
Version: 4.9.0-2641355+++depot+UE4-Releases+4.9

System Specs:
OS:Win8.
Additional specification will be provided by request.

Attachments: It will be provided by request.

Detailed description of the issue:
Construction script were not executed if object was putted by level editor.

Screenshots/Link to video: It will be provided by request.

Reproduction steps:

  1. Create a new blank project.
  2. Create actor BP.
  3. Call “Print String” in ConstructionScript function.
  4. Put actor on main scene by level editor.
  5. Make sure that actor exist in scene, but the text was not appeared on screen.
  6. Spawn actor in BP(level BP as example.)
  7. Make sure that actor was spawned and the text was appeared on screen.

Frequency: 100%

Expected behavior:
ConstructionScript should be executed in anytime when object was created.

Hi Alexios,

The Construction Script is actually executing anytime the Actor is placed into or moved within the Viewport. If you open the Output Log, you’ll see that it prints every time the Actor is placed in the level, and every time it is moved in the level.

It looks like this is a bug with Print String not printing to the Viewport screen when the Construction Script is executed, so I’ve entered a bug report (19924). I’ll post here when I see any update on it.

Thanks for the report!

Hello, Ben.
Unfortunately, but no. I have discovered this problem after I have tried setup some object properties in a ConstructionScript function.

P.s. Thank you for karma.

I think that Event Begin Play will work for what you are trying to do.

Construction scripts are called when the object is constructed, which can be when you place it in the level or when you call a node to spawn it in blueprints; I had the same problem until I developed a better understanding of what construction scripts were for.

Hi Alexios,

There are some limits to what you can do in the Construction Script, depending on the order of creation. If you’re attempting to make changes to other Actors from the Construction Script of another Actor, you need to make sure the Actor exists first.

Can you be more specific about what you’re attempting to accomplish, and what isn’t working? The Print String example has already been explained, so I’ll need another. Thanks!

Hello, Ben.
The main issue is a ConstructionScript is not invoked for objects those placed via level editor.
I have not problems any problems with objects those was constructed from a “spawn actor from class” function.
I give a two addition reproduction sequence to make sure problem is not related with “Print String” function.

First one.
Reproduction steps:

  1. Create a new blank project.
  2. Create actor BP.
  3. Call “Quit game” in ConstructionScript function.
  4. Put actor on main scene by level editor.
    !5. Make sure that actor exist in scene, but game was started. ConstructionScript was not invoked so game did not execute quit node.
  5. Spawn actor in BP(level BP as example.)
    !7. Make sure that after you have pressed play button, the game was not started because the game execute quit node.

Second one.
8. Put break point on quit node in ConstructionScript function.
!9. Make sure the breakpointed paused game only for object that was created by “spawn actor from class” function.

Do you need a third example how to reproduce the bug?

No.
Let change the title from “Event Game Begin” to “Event Race Begin” for a simply example.
Than, just ask yourself a question "Should I fill car fuel tank before a “Even Race Begin” or after “Even Race Begin”?

That’s not what the Construction Script is for. The Construction Script is executed when the the Actor is constructed, but when you Play the Actors in the level are already constructed. If you spawn it in, then it will run the Construction Script.

The Construction Script can be used for adjusting values and adding components while moved around inside the level, but this isn’t the expected place to run gameplay events, such as Quit Game.

Just to update, this problem is still present in Unreal 4.14.

Hi Wuppy29,

This bug report is still active in our system. Here is the public viewable version: UE-19924

Feel free to vote to help increase the priority level. I’ve also posted on the internal version that users are still asking for this to be fixed.

Cheers,

TJ