I have a map of hexes of the same blueprint class, which either:
- are of a specified type
- or calculate the type automatically, depending on their neighbours.
To find neighbours, I’m getting the location of all hexes on a level and check if the distance between current hex and the other is smaller than 3300 units.
If I do it by a straight reference, I’m given bad locations - though it happens only in Simulate/Play. In editor, everything is OK. It doesn’t matter if the blueprint uses Get Distance or subtraction of vectors.
The workaround, which solves the problem, is to store the location of self in a variable. Then all the hexes query that variable, instead of using Get Distance or retrieving the location directly.
Here’s a thread on UE4 forums: Construction script behaves differently in editor than in Simulate (hex map) - Blueprint - Unreal Engine Forums