Hi everyone! I’d need some help for solving an error by project run into without affecting the gameplay. For my mobile building game I have a Level blueprint where I handle the results of player’s tapping. For building something I then check if there is already an object spawned on the designated location by saving each building’s position upon construction and using an array to quickly check if the area is empty or not. (First picture). The occupied coordinates are saved through a constructor class which is an object working as a preview of a building and can be moved onto a grid and then confirmed through game user interface. This is the script regarding coordinates’ saving. (Second picture). Everything works fine during gameplay, but somehow I receive these errors (third picture). Question is: why is this happening? Someone online suggested to use an “IsValid” function to solve the issue but as a result it does not work properly anymore, allowing buildings overlap. I have checked with prints: the code works perfectly but I still get those errors and I am not able to find a solution. Anyone here had the same problem and can share the process for solving it? Thannk you for your attention.
PS: I don’t know if I have uploaded the correct code parts, since it is the first time I have run into this particular issue. If, for solving it, you need another part uploaded I will happily attach it to this thread, just ask!