How can I adjust the actor's position when placing in editor

I want adjust the position when placing an actor to the grid in editor. I try to do this in Blueprint’s construction script, but everytime I drap the actor, it process the construction at the same time. So I can’t move the actor at all.
thanx for help!

73586-qq图片20160109122353.png

73584-qq图片20160109121248.png

When you place it the construction script will be run. When you then try to move it on every engine update it will run again. Meaning with the script like this once you placed it, it will snap back to it’s old location because it’s still the closest location there is.

I would suggest using a bool variable which you quickly check and uncheck in the editor right before setting the actor location. So you can move the actor where you want it (round about) and let the last step be done by the script to be exact.

Alternatively you could only move the position of the mesh (or whatever you use) on the grid and leave the actor position unchanged. Since everything within a blueprint works via a strict hierarchy you can just add all components but the root component as child of another component and snap the position of that one to the grid rather than the whole actor.

Cheers

Hi Erasio, thanx for help! I am sorry I still have no idea how the bool variable works. Since the construction run continually, it set the position continually, how can I determine the value of the bool variable? It seems okay when draging the actor set it false, and at the moment the mouse released set it true. However I can’t get mouse event in construction.

Thanks! I found an option in Class Settings to disable run construction when dragging, uncheck it can reslove my problem.

73593-qq图片20160109190138.png