Hey guys! I hope you all do very very well! Being direct, I’m trying to constantly move a block from the Workspace to the player’s mouse position. The problem is that the mouse doesn’t have a “mouse.Z” so I can’t complete the script without it giving an error (because of the missing Z position).
I’ll be grateful with you if you can give me a hand with this, even if it’s the smallest one, thanks for reading, and here’s the script if you can help:
(I’m trying to move the block without clicking it and when the mouse position changes) so if you move the mouse to a wall for example, the block will go to the exact same mouse position:
Something like this:
Here’s the script:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
--This is the block name (Target)
local mTarget = game.Workspace.Target
mouse.TargetFilter = mTarget
mouse.Move:Connect(function()
local posX, posY = mouse.X, mouse.Y
local posZ
mTarget.Position = Vector3.new(posX, posY)
end)
Thank you for reading and have a nice day! byee!