Device when I start the Unreal Editor and when I build code

Yes I’ve tried that but the issue still persisted, I ended up just creating another file and copying exactly the same code into the new one and the issue seems to have stopped. Maybe the last file was bugged or something.