So I have a blast system for my game, where players fire at each other using spheres. I used body velocity for this system. The problem is, at first, the bullet lags because it is just placed, then it starts moving. This makes the gun harder to use and not enjoyable. Is there any way I can fix this?
My code:
This isn’t exactly lag, rather something to do with the physics engine. One thing you can do to alleviate some of this is to apply the force before parenting the fireball. I’m clueless beyond this though.
Usually changing the network owner of a part causes it to freeze for a moment. Have you tried setting it to the player or cloning a part that already has the network owner set to nil?
What if you stored the bullet inside the gun model and welded it? Then at the start of the script it sets the network owner, and when the gun is fired it clones the bullet and calls breakjoints?
I have scripted a gun in the past but I used cframe instead of body movers, so im not completely sure if this will work.
This is due to sleeping physics. Even if you have Network Ownership, the parts will sleep when Instantiated initially. The only way to resolve this is to have your physics part be created locally. What I would do is have a server-side copy and a client-copy. Use the server for hit validation and client for display.