Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Could I Get Color From A Position?

I Am Making A Color Wheel And I Dont Know How To Get Color From Position Of The Cursor

Thanks

1 answer

make this a local script if you're using a gui it won't work

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
-- Check that there exists a part at which the mouse is pointing
if mouse.Target then
    print(mouse.Target.Parent.BrickColor) -- the part's brick color 
end

2 comments

0

-1 for bad code, mouse.Target already refers to the BasePart and therefore you can literally print mouse.Target.Parent to find what the parent is

0

Okay! Thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.