[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 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 text was not appeared on screen.
  6. Spawn actor in BP(level BP as example.)
  7. Make sure that actor was spawned and text was appeared on screen.

Frequency: 100%

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

Hi ,

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

It looks like this is a bug with Print String not printing to Viewport screen when 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 report!

Hello, .
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 object is constructed, which can be when you place it in level or when you call a node to spawn it in blueprints; I had same problem until I developed a better understanding of what construction scripts were for.

Hi ,

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

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

Hello, .
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, game was not started because game execute quit node.

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

Do you need a third example how to reproduce bug?

No.
Let change 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 Construction Script is for. Construction Script is executed when Actor is constructed, but when you Play Actors in level are already constructed. If you spawn it in, then it will run Construction Script.

Construction Script can be used for adjusting values and adding components while moved around inside level, but this isn’t 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 public viewable version: UE-19924

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

Cheers,

TJ

This is still reproducible for me at time of writing this message (11-April-2023).