Download

OnConstruction() doesn't call when component moves, but Construction Script does

Hi guys just posting a solution I found to this problem. Basically everywhere I looked I found people telling me that the OnConstruction() function was the c++ version of the construction script in blueprints. Whilst this is mostly true, it doesn’t run every frame while an object is being moved in editor. Overriding PostEditMove(bool bFinished) and putting my code in there fixed the problem, and now my c++ code is run every frame when the actor is moved in editor.

Does whatever property you are editing depend on location? Then it makes sense that it will fire every time you move it.

Also, I’ve never used it but does that bFinished variable do anything? Would think it was true only if the user let go of the moving object.