FastCastRedux Help

I was trying to make a gun using FastCast but when I tried to shoot it I got this error:

Workspace.template.ServerScript:61: attempt to perform arithmetic (sub) on Instance and Vector3

full function:

local function ActivateFirearm(player: Player, mouseHit: Vector3?)

	local OriginPoint = GunFirePoint.WorldPosition
	local DirectionTo = (mouseHit - OriginPoint.Unit)


	varCaster:Fire(OriginPoint, DirectionTo, SettingsModule.BulletVelocity)


end

does mouse.Hit Return an instance instead of a Vector3? That`s the only reason why I can think this would be happening

1 Like

i dont think u need the player argument in the function, it cant do math on the player

But I’m referencing the mouseHit in the function not the player. I don’t see how that would affect it.

I Figured it out, the first parameter in a server event is always the player, but thank you

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