How can I make a script that when you are a certain amount of studs from something it disappears and when you go closer it reappears

I want to make a script that the title explains, I feel like this would be a good solution for lag on a tycoon game.

You can check the magnitude of the center of the model’s position - the HumanoidRootPart’s position. If it’s too high, you can parent it to ReplicatedStorage.

Create a table of all the models that should be checked and loop through it every few seconds or so

1 Like

If you are having issue with lag due to the part count, I’d highly recommend using StreamingEnabled but you would need to make sure your scripts can support that.

1 Like

Tried making it, I don’t know how.