Hello, I’m making an Ocean Using Mesh and bones but I have a slight problem. The waves lag only in game, In studio it seems perfectly fine.
I’ve seen other people use a technique where the Mesh and bones only become visible when you get close enough to it.
Does anyone know how to do this? Please help.
Example of what I believe happens in this game (I think the game renders chunks only when the player is a certain distance away to prevent the bones from lagging)
That is true. So you might have tried this but dont animate the ocean in Server script. Have a table that stores points of area from the ocean in a table, loop through the table and find which one is closest, and animate that section of the ocean in the LocalScript.
Each point is for a part of the ocean.
I’ve created something, but its limited. The Ocean waves work, and it renders with the players Camera using the Fustrum culling method. The small problem is if i go over 5000 Chunks in the workspace (not enough) The CPU goes insane, and when a player joins they’re screen freezes For 5 - 10 minutes.
Render the waves on the client and sync your function with workspace.DistributedGameTime
I render bones based on the parent mesh’s distance and bone’s distance from the character/camera. I also reduce render time the further out the bones are and stop at a certain distance. Distant bones that are able to be animated are also only animated if they are visible to the camera.
Still needs some work with characters floating on the surface but here is an example: