Hi,
So I’m trying to make a game where objects generate around the player, to reduce lag. I really just want grass blocks to appear, and models appear about 1000 studs around the player.
Any help apperciated.
Hi,
So I’m trying to make a game where objects generate around the player, to reduce lag. I really just want grass blocks to appear, and models appear about 1000 studs around the player.
Any help apperciated.
You could use StreamingEnabled for this and specify the radius.
I don’t want that,
I basically want a script that generates trees in.
(Note I already have the model)
If you’re making the custom rendering system I think you want, you’re going to need to calculate the radius around the player, determine the models inside that radius, and probably parent them to ReplicatedStorage. You would also need to account for adding things back into the workspace from ReplicatedStorage when the player moves. I don’t think this is great, since you don’t want to loop through and check the distance of every model.
I assume this is what you’re asking, but I don’t think it’s as efficient as splitting your map in different chunks and you might have the current chunk you’re standing on and the surrounding chunks loaded in. When you move to another chunk, you would load in and load out accordingly.
The best implementation imo would be a space partioning structure. You can research this further but the general gist is that the models, trees in your case, would be put into ‘buckets’ and you check the distance to the bucket from the player and load in/out accordingly, as opposed to individually checking the distance to every model.