Set location doesn't work?

So i’m trying to add the location of an actor to an array just as it spawns but for some it reason
the array only returns 0x, 0y and 0z. pls help???

Hello Winakaro!

From what im seeing, you are trying to add a vector to the location of the actor. in order to do that without reseting the actor location to the point 0, you can use the node add local offset, it will add the desired ammount of the vector to the current actor location.

Hope this helps!

1 Like

Hey @Winakaro, the problem is that the vectors are non-zero, but when you check the array later you only see zero-vectors?

If that is the case maybe try making a new FVector, set each coordinate with the Actor’s location and save that one instead. It might be that the vector is being garbage collected.

Hope this helps

so i’ve realised i haven’t quite correctly explained it so the default value of the array is 0x 0y 0z eventho i clear the array on begin play.
i spawn in the first actor. It doesn’t set the new location value correctly. Afterwards i spawn in a second actor which for some reason makes the correct value pop up for the second location but not the first and then i spawn in a third actor and when i print out the array it prints all the values even the first.

Fixed it. thx for the help. for anyone else that’s made the same mistake. just add a delay in front of the function.