I'm trying to make a gui stay where ever a part is in the workspace, and to prevent me from having to write hundreds of repeated lines of code, I want to make a system in the gui that will detect if your near a button. I'm most of the way done with this code:
for _,i in pairs(game.Workspace:GetDescendants)
if i:IsA("UnionOperation") and i.Name == "Button" then
--i dont know what to put here, this would be what tells the script it is a button
end
--[[local V2 = WorldToScreen(what do i put here so that i can get the parts in the workspace that have the name button and access their position?? )]]--
so basically i dont know how to make sure a part has a certain name and the get its position

4 comments
I Didnt Quite Understand Your Question, what Do You Exactly Want To Do?
After Accessing The Buttons Position?
I would want to create a variable of some sort that contains the position of the part if it has the name "Button"
Use CollectionService instead of game.Workspace:GetDescendants().