In my game, I send the center of the screen to the server and fire projectiles based off of that.
Client
local currentCamera = workspace.CurrentCamera
local VIEWPORT_SIZE = currentCamera.ViewportSize
local unitRay = currentCamera:ViewportPointToRay(VIEWPORT_SIZE.X / 2, VIEWPORT_SIZE.Y / 2)
module.abilityEvent:FireServer("PrimaryFire", {unitRay.Direction, unitRay.Origin})
The server then handles the damage dealing and fires an event to the clients to handle the projectile.
Server
local simBullet = myCaster:Fire(origin, direction, weaponAttributes["Bullet_Speed"], CastBehavior)
RS.Remotes.visualEffect:FireAllClients({'ViviPrimary', myPlayer, origin, direction, weaponAttributes["Bullet_Speed"], weaponAttributes["Max_Distance"], myBools["Enchantment"]})
Client
myCaster:Fire(origin,direction,soeed,castBehaviour)
This is fine for actual gameplay, as the bullets go exactly where I want them to.
https://i.gyazo.com/b10600959ce12945fbedae9817ee23f6.gif
However visually I would want the bullet to spawn from somewhere else while still going in the same location. (For the example I would like it to spawn from the character’s right hand) However when I do this it messes up the trajectory. How would I be able to do this so it’s still accurate to what’s actually happening on the server?
https://i.gyazo.com/24dc369e9ab6e5b68670ccc3ea891014.gif
I am also using Fastcast if that plays into anything.