Hey, thanks for the response!
In a way, I believe I’m already doing what you’re suggesting, but slightly different. Rather than using the Cursor for getting the Mouse.Hit.Position
, I began using a Raycast from the center of the screen and then returning that position.
local function GetCenterOfScreen()
local position = Camera.ViewportSize / 2
local unitRay = Camera:ViewportPointToRay(position.X, position.Y)
local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = {Character}
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = Workspace:Raycast(unitRay.Origin, unitRay.Direction * 1_000, rayParams)
local hit = CFrame.new(raycastResult.Position)
return hit.Position
end
Although even with this, the issue still persists, unfortunately.
I was curious if you had an idea of how to get the direction forward of barrel? Currently I calculate the direction using the following equation fireDirection = (mousePoint - FirePointObject.WorldPosition).Unit
.
Additionally, for anyone else who might be curious about the issue, as my previous Gif might not have shown it off greatly, here’s a better one:
