Anchored Parts Not Updating

I’m trying to make destructible objects in a driving game, but unanchoring parts occasionally just doesn’t seem to work:

  1. Collision between vehicle and object is detected client side, object initially has CanCollide = false
  2. Vehicle speed recorded
  3. Object unanchored client side
  4. RemoteEvent fires, unanchoring server side and setting network owner to the appropriate player
  5. Wait X steps, initally one, later went up to 3 with no apparent difference
  6. Update CFrame client side of the object to be original postion + recorded velocity * dt
  7. Object collisions enabled client side

About 95% of the time, this works exactly as expected. The other 5% of the time, the vehicle bounces off the object like it was anchored, and then the object slowly falls over. The scripts are still firing in the correct order, and working the same as they do the rest of the time, but the physics engine just doesnt seem to be updating. Did the parts unanchor straight into sleep mode or something?

At this point there’s really no reason to have the destructable objects on the server. You’re only causing yourself issues. You should have an entity on the server to “represent” the destructible objects, and simply spawn those objects on the client when the player gets within x distance of them.

After putting some thought behind the fact you may want other players to also see these objects. It is true that sleeping parts does happen, but generally the parts wakeup when you get close to them. In this case, you can unanchor the object and enable collisions on the server from the remote event, and set the network owner to the appropriate player and then handle step 6 locally on the client.

3 Likes