Help with fastcast

hello developers. I am trying to implement the fastcast module into my fps framework, the firing works but it is not shooting from the barrel. And i have no idea how to fix it

Here is a video of the issue
The problem

The code that i am using to shoot from the barrel attachment

function fire()
	local origin = game.ReplicatedStorage.Modles.TimberWolf.TimberWolf.Handle.muzzle.WorldPosition
	local dir = (mouse.Hit.Position - origin).Unit
	resources.fire:FireServer(origin, dir, 300)
end
1 Like

You’re getting the position from the original model, which is going to be in a fixed position. That means you have to reference the cloned model which the player is interacting with.

i am not 100% on how to do that

Where is the gun located? A tool in StarterPack, or inside CurrentCamera, etc?

the weapon is located in the StarterPack

Then you want to get the position from the tool inside the player’s character (which is where tools in StarterPack are replicated to):

local origin = game.Players.LocalPlayer.Character.TimberWolf.Handle.muzzle.WorldPosition

whoops i said the wrong thing the weapon is inside the CurrentCamera sorry about that

Then you can simply just get it from CurrentCamera: (^▽^)

local origin = game.Workspace.CurrentCamera.TimberWolf.Handle.muzzle.WorldPosition
1 Like