Issue with creating bulletholes

I’m trying to make it so that whenever I shoot, a bullet hole (transparent part with decal on) goes to the mouse position, but for some reason the position isn’t changing and all of the bullets are going to 1 area, could someone help?

Also MouseHit is mouse.Target and mousePosition is mouse.Hit

Server Script

fire_event.OnServerEvent:Connect(function(player, mouseHit, mousePosition)
	local bulletHole = game.ReplicatedStorage.BulletHole:Clone()
	bulletHole.Parent = workspace
	bulletHole.Position = Vector3.new(mousePosition)
	if mouseHit ~= "nil" and player.Character.Humanoid.Health > 0 then
		fireEffect()
		if mouseHit.Parent:FindFirstChild("Humanoid") and mouseHit.Parent:FindFirstChild("Humanoid").Health > 0 and player.Character.Humanoid.Health > 0 and mouseHit.Parent then
			if mouseHit.Name == "Head" then
				mouseHit.Parent:FindFirstChild("Humanoid"):TakeDamage(40)
				fire_event:FireClient(player)
				if mouseHit.Parent:FindFirstChild("Humanoid").Health == 0 then
					killed_player_event:FireClient(mouseHit.Parent)
				end
			else
				mouseHit.Parent:FindFirstChild("Humanoid"):TakeDamage(30)
				fire_event:FireClient(player)
				if mouseHit.Parent:FindFirstChild("Humanoid").Health == 0 then
					killed_player_event:FireClient(mouseHit.Parent)
				end
			end
		end
	else
		fireEffect()
	end
end)

try mousePosition.Position
character limit

1 Like

They still spawn in 1 certain place.

can i see the code for the client?

	elseif firemode == "Semi" then
		if mouse.Target then
			fire_event:FireServer(mouse.Target, mouse.Hit)
			currentAmmo -= 1
			camera.CFrame = camera.CFrame * CFrame.Angles(math.pi / 75, 0, 0)
		else

try printing moue.hit.postion, or something

you must do mouse.hit.Position, try that.

You don’t need to include Vector3.new()

1 Like

To add onto this, to align your bullet hole correctly with the hit spot, you must use the raycast’s normal.

bullethole.CFrame = CFrame.new(pos, pos + normal)

Hope this helps!

2 Likes