You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? 2. What is the issue?
When shooting the ball while walking it doesnt start where it should start(humanoidRootPart) but works fine when standing still
You see, when you’re referencing the position of the humanoid root part on the server (while in motion), there’s a miscommunication as of where your HRP actually is, due to client-server lag. If you want a more accurate positioning, try passing the HRP’s position from the client to the server as an argument in your remote event!
I was dumb. I put the declaration at the beginning of the script now i out it in the function but it still got a smaller distance is there a way to fix this? :
If you mean the projectile sometimes flying off into the distance, then I suspect it may be considering the projectiles themselves as a valid mouse target, therefore mouse.Hit gets a CFrame near the projectile you’ve already fired rather than where you were intending to aim. I believe you could use mouse.TargetFilter to exclude projectiles when getting mouse.Hit.