I’m currently trying to make a VR weapon, it’s connected to hands by a weldconstraint. I’ve bumped into an issue where when I moved the gun the bullets were lagging behind and were shooting in random directions, so I put two parts for debugging, the first one to show the origin position, and second to show the direction, they were lagging too as you can see.
I tried running the script client side so far but I did not succeed, I used both .renderstepped and .heartbeat for debbuging. I think it has something to do with physics and constraints.
try setting the network owner of the gun to the player. so the weld and those parts position is set by the player. see if that improves the local responsiveness
Sadly, did not work, still the same lagging
where is the weld parented to? is it in the gun
It’s parented to the gun mesh root
i dont understand. the gun follows the hand perfectly. so should just use that for the shoot direction
The issue is that the position i get for bullets is still innacurate
i notice the bullet starts at the back of the gun. move it to the tip of barrel.
because bullet i think is generated on server, it will inevitably have a delay. if it appears at the back , it will almost sure travel in a different direction then the barrel direction
moving fire point to the tip helps to hide this a bit.
still not sure why it lag that much though. because of vr?
i have a game, got a crossbow that shoots bullet. it is calling Crossbow.Shoot.RemoteEvent:Fire(position, velocity) and it appears following the crossbow quite well
I tried doing the same thing I did to the anchored part but with hand, which is itself, a non physics objects. The results are the same so we can rule out physics, so it’s a replication issue, now I don’t fully know how do I fix that.