Building tool not working

I spent a while making a tool that places blocks at the position of the mouse for my building game, and there is no errors. but for some reason, the tool does not place blocks on any -axis face of a part. I could not find any solutions for this, so here is the script.

wait()
script.Parent.Activated:Connect(function()
	local Player = game.Players.LocalPlayer
	local Mouse = Player:GetMouse()
	
	local NewPart = Instance.new("Part")
	
	NewPart.Size = Vector3.new(1,1,1)
	
	NewPart.Parent = workspace
	
	NewPart.Anchored = true
		
	NewPart.Position = Vector3.new(math.round(Mouse.Hit.Position.X), math.round(Mouse.Hit.Position.Y), math.round(Mouse.Hit.Position.Z))
	NewPart.Position = Vector3.new(NewPart.Position.X, NewPart.Position.Y + NewPart.Size.Y/2, NewPart.Position.Z)
	
	
	print(NewPart.Position)	
end)

and here is a vid showing how it’s not working:
here

When in doubt, use B-tools from HD Admin

I don’t want to make my game to look like a low effort game with an un-unique toolbox building system, but if I can’t find a solution, maybe.

1 Like

I respect that. Using free models isn’t a good idea for making your game popular.

What I was implying to is to look at the b-tools from HD Admin, and try to create your own with inspiration from the b-tools.

OK, I’ll try that. Thanks! (30 letter)

1 Like

Hi there, Justa tip, always keep an eye on API doc,
local Mouse = Player:GetMouse()

is now depriciated. So worth upgrading to the new API stuff at the same time as fixing your issues :slight_smile: good luck

Thanks! (30 letters eeeeeeeee)

do you recommend user input service or context action service?

sorry im kind of not focusing right at the moment (very tierd), look at mouse.hit api doc and it tells you what to use instead :slight_smile: GL

1 Like