Problem with block placing tool

Hello, today I have a problem with creating my block placing tool, first, I have a tool that I click to activate and my mouse is hovered over an existing part, and then it sends a remote event fire over to the server to place the block at my cursors position. But instead it’s placing it on the middle of my world.

I am getting this error:

Hit is not a valid member of UnionOperation "Workspace.Grass" 

localscript:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("DirtPlaceOnServer")

script.Parent.Activated:Connect(function()
	remote:FireServer(mouse.Target)
end)

Server script:

local remoteevent = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("DirtPlaceOnServer")
local dirt = game.ServerStorage:WaitForChild("Blocks"):WaitForChild("Dirt")

remoteevent.OnServerEvent:Connect(function(player,obj)
	local dirtclone = dirt:Clone()
	dirtclone.Parent = workspace
	dirtclone.Position = Vector3.new(math.floor(obj.Hit.Z),math.floor(obj.Hit.Y),math.floor(obj.Hit.Z))
end)

I’m not sure how to solve this.

1 Like

Do you have a part or whatever with the name of “Hit” in workspace.Grass ?

Hit is not a part in workspace.

Well, the obj in “OnServerEvent” is Workspace.Grass if we assume that Grass does not contain an object of the name of Hit, it is normal to have an error because Workspace.Grass.Hit don’t exist