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.
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.
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:
Create a new blank project.
Create actor BP.
Call “Quit game” in ConstructionScript function.
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.
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.
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.