Bullets firing from the center

I ran into an issue with Fastcast where my bullets are starting from the center of the map:

Local script:

local Tool = script.Parent
local Handle = Tool.Handle
local fp = Handle.FirePoint

local Mouse = game.Players.LocalPlayer:GetMouse()

Tool.Activated:Connect(function()
	game.ReplicatedStorage.FireBullet:FireServer(Mouse.Hit)
end)

Server script:

local Fastcast = require(game.ServerStorage.FastCastRedux)

local Caster = Fastcast.new()
Fastcast.VisualizeCasts = true
local Tool = script.Parent
local Handle = Tool.Handle
local fp = Handle.FirePoint

game.ReplicatedStorage.FireBullet.OnServerEvent:Connect(function(plr,mouseCF)
	local direction = (mouseCF.Position - fp.WorldPosition).Unit
	
	Caster:Fire(fp.Position,direction,150)
end)
2 Likes

I’m not really into fastcast, but I think I can help you. Wouldn’t it be easier, when passing the direction, to use a LookVector from a CFrame?

local direction = CFrame.new(fp.WorldPosition, mouseCF.Position).LookVector

Thanks for help but unfortunately that didn’t work. Same result.

1 Like

We were a bit foolish now, haha.

What’s happening is that the fire point is an attachment, and you’re getting its position, not the world position.

Caster:Fire(fp.WorldPosition,direction,150)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.