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

Finding a UDim2 position on a surface gui?

For example, I have a part which has a SurfaceGUI on a given face, and then cast a ray onto the part, hitting said face. Using the hit position from the ray, how would I go about translating that into a UDim2 Position on a SurfaceGui?

Gimme a yell if it needs to be edited again.

3 comments

0

Depends on what part of the Surface GUI you are looking for. Example: The frames and components involved inside the surfaceGUI

0

Which reference frame, the camera's or looking straight at the GUI?

0

You need to rephrase your question, im pretty sure we are all confused

1 answer

I'm not sure exactly what you mean but here are two way's to get "a part's surface gui position".

Detecting the side of a SurfaceGui It's pretty simple to do this, all you need is a variable and the SurfaceGui object.

side = game.Workspace.Part.SurfaceGui.Face
print("The side of the SurfaceGui is".. side) -- Shows which side it is in the output.

Detecting the position of a SurfaceGui

position = game.Workspace.Part.SurfaceGui.AbsolutePosition
print("The position of the SurfaceGui is".. position)

Hopefully I understood your question and helped. If this helped, please go ahead and accept this answer.

1 comment

0

Updated the question now, apologies for the confusion, but thank you all the same

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