So I’m looking into making a tank with a realistic drop-off on the gun’s bullets and I’m wondering what the best and most efficient way of doing such is. I’ve looked into it and it seems that using BodyVelocity is not smooth and doesn’t work well. Raycasts may be an option, but it brings into question whether or not the bullets and hit detection should be handled by the client. I’m wondering what the best way about doing this would be. Any help is appreciated.
As far as I know, you sort of have to use something like BodyVelocity LinearVelocity or ApplyImpulse, because raycasts can’t have drop off, unless you make a custom system to calculate the trajectory and check along the path to see if it collides.
In what way is the physics based bullet not smooth? Maybe you have an issue with network ownership? (I believe that as network ownership switches, there is a potential for glitching)
Also, if you do use raycasts, neither the bullets nor the hit detection should ever be done on the client – it would make exploiting almost trivial.
Edit: Don’t use BodyVelocity (or any other BodyXXXX) as it is deprecated, use LinearVelocity as a direct replacement, or ApplyImpulse
BodyVelocity is deprecated. What about ApplyImpulse()?