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