I’m going to make a board that can be written on. I need help for this. I’ve looked everywhere I need to look but can’t find anything about it.I’ve been working for this for a long time.
Problem: I need a board that can be drawn on hover and click.
IMPORTANT NOTE: Only some people will be able to write on the board.
I’ll be happy if you can help me!
This is a decent tutorial (it’s not perfect by any means, but it works):
The main difference would be that you would use a surfaceGUI and check for whether the player is allowed to write on the board (which could be achieved through a couple of simple if statements).
I have no idea why it wouldn’t. You just need to replace the UI used in the video with a SurfaceGUI (i.e Parent a SurfaceGUI with an imageUI or frame of your choice to a part).
local Board = workspace.WhiteBoard.SurfaceGui.Board
local mouse = game.Players.LocalPlayer:GetMouse()
local RelativePart = workspace.WhiteBoard.RelativePart
local x
local y
local pos
local pressed = false
mouse.Button1Down:Connect(function()
pressed = true
end)
mouse.Button1Up:Connect(function()
pressed = false
end)
mouse.Move:Connect(function()
pos = mouse.Hit:PointToObjectSpace(RelativePart.Position)
x = pos.x
y = pos.y
if pressed and mouse.Target == workspace.WhiteBoard then
local dot = Board.Dot:Clone()
dot.Parent = Board.Dots
dot.Position = UDim2.new(0, (-x*100)/2, 0, (y*100))
dot.Visible = true
end
end)
It’s a part that you could use to get the relative position of mouse.Hit. This would enable you to apply 3d vectors into 2d space (the frame) more easily. There are probably better methods, but I would be surprised if that didn’t work. I haven’t tested it extensively so it might have flaws.