Client-sided explosion issues

I’m having a bit of trouble moving explosion logic for my game to the client side. This has been a very laggy part of my game fro a while, and moving the physics part of this to the client seems like a good idea.

When I first tried just moving this physics logic to the client, parts wouldn’t be affected until the player got close to them, then I thought this was a NetworkOwnership issue, and I moved all the destructible buildings in the game to ReplicatedStorage and had the client “unpack” them into Workspace when they joined, but now as far as the server is concerned these buildings don’t exist and if the client doesn’t take ownership of the bombs for some reason, they just go through the building.

Is there a better way to achieve this?

Moving physics to the client for THIS is a good idea.

How do you handle bombs? Does the server decide when and where they spawn? If a bomb is created on the server but buildings aren’t there, it will pass through them until the client takes over. Once the client has control, it handles physics, and since buildings exist on the client’s side, the bomb won’t go through them.

2 Likes

the server decides when they spawn, is there a way to allow the client to take control of them permanently? they’re also unanchored so it won’t let me set networkownership to the client

I’d set it up this way:

The server decides when and where to spawn bombs → sends info to the client → the client spawns the bombs using the info.

If synchronization between clients isn’t a big issue for you, this should work well. Otherwise, it gets muuuuuch more complex.

1 Like

synchronization forms the whole foundation of my game :woozy_face:

i stand corrected, apparently

i don’t know where i read that it was unanchored baseparts but you can set unanchored baseparts networkownership to a client

working on it now

after replacing the :ApplyImpulse calls on the server with a call to a remoteevent to get the client to apply velocity to the bombs, this works perfect! thank you so much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.