Local Offset Keeps Moving Mesh

When you add a local Offset to a Mesh in the construction script every time you compile it will add to the offset. When you look in the view port the mesh will be really high until you close and reopen the BP.

Do you know of anyway to prevent this from happening?

Thank you.
John

Use SetRelativeLocation instead of AddLocalOffset or use AddLocalOffset but in BeginPlay

Thank you Hustlan for the information. I had tried the SetRelativeLocation but since these are being spawned the Z is correct but it will spawn the X and Y at 0 0.

Adding AddLocalOffset but in BeginPlay does work even when spawning but it causes the spawning to be inconsistent, like you will click the button to spawn and it sometime will spawn and sometimes will not spawn, if you click the button 3 or 4 times it will finally spawn with correct offset. Once I changed it back to the construction script they all spawn perfectly.

I will have to keep the offset in the construction script for now, I guess it is a glitch that it keeps adding to the offset each time you compile unless you close and reopen.

It’s not a glitch, construction script in blueprints fires every time you compile them or move their instances on the level to provide you the correct results.

As for SetRelativeLocation, you shouldn’t pass there the same values from AddLocalOffset, you should first use GetRelativeLocation, add the value you used in AddLocalOffset and then pass the result into SetRelativeLocation.

Thank you again Hustlan, I appreciate your help! With you help I ended up in the Construction Script doing the following:

Construction Script > SetRelativeLocation X0 Y0 Z0 > AddLocatalOffset X0 Y0 Z60

Now when you compile it will move the mesh back to 0 0 0 and then from there it will set the offset, this keeps it from adding offset each time it is complied.

Thanks again for your help.