Skip to content

General methods of G3 objects

TheEpicBruhman edited this page Aug 24, 2026 · 20 revisions

There has been a lot of prebaked methods to make using G3 easier.

Some are on gui only (g3Gui), some on parts only (g3Part), and some on both (g3Any)

Methods on all g3 objects

Methods only on g3Guis

Methods only on g3Parts


g3Any

g3Any:Velocity(point: g3.point)

Adds to the g3Any's g3.point this new point. Think of this as defining an instantaneous velocity for the next frame

Automatically handles partial points (such as only inputting Rotation or Position)

Using Velocity in a for loop with Position (0.1, 0) and Rotation (1, 0, 0)

Velocity only affecting the top GUI and its parts, and not any children GUIs

g3Any:Clone()

Creates a shallow clone of the g3Any

g3Guis do NOT clone their children g3Gui, only their Parts

Cloning my GUI 5 times and using Velocity at Position (6, 0) every time without children GUI cloning

g3Any:Destroy()

Destroys the g3Any AND all of its children and parts, if any

Destroying my GUIs

g3Any:CustomProperty(key: string, value: ~nil, customCallback:
(g3Any: g3.any, oldValue: ~nil, newValue: any) -> ()?)

Used as a constructor to add custom properties to the specific g3Any

Mostly an internal function, although you may find some use in it

Optionally define a custom callback when that value changes. On callback, passes the object, the old value, and the new value
This callback happens before the actual value is changed

Code snippet

--Setup
local gui = g3.NewGui("test")

gui:CustomProperty("myProperty", 50, function(_, oldValue, newValue) 
	print(oldValue, newValue)
end)

gui.myProperty = 5

gui.myProperty = "five"

--This code snippet prints out:
--50 5
--5 five

g3Any:BindPartToTable(value: Instance, nameOfValue: string)

Mostly an internal function, but is useful if you are dealing with adding new instances parented to your g3Any.

Adds the instance to the top level of the g3Any table, while also handling unique naming and inheriting the g3Any's name

Doesnt automatically parent it to the g3Any

Code snippet

--Setup
local gui = g3.NewGui("test")
local iWantToBindThisInstance = Instance.new("Weld", gui.Model)

gui:BindPartToTable(iWantToBindThisInstance, "Weld")

--[[
This prints out

 {
                    ["BindPartToTable"] = "function",
                    ["Clone"] = "function",
                    ["CustomProperty"] = "function",
                    ["Destroy"] = "function",
                    ["Model"] = test,
                    ["Velocity"] = "function",
                    ["VelocityIterative"] = "function",
                    ["Weld"] = test's Weld,  -- Our new binded part  
                    ["__internal"] =  ▶ {...}
}

]]


g3Gui

g3Gui:VelocityIterative(point: g3.point)

Functions the same as Velocity, but ALSO passes the velocity on to all of its children GUI

Moving all of my g3Gui at once


g3Part

g3Part:AttachSurfaceGui(name: string)

Used as a shorthand for easily adding new Surface Guis to parts

Made specifically for creating G3 GUIs from scratch, as it automatically attaches the Surface Gui to the back face

Default 100px per stud

Attaching a Surface Gui alongside adding a frame with a red background color

Base

Basics

Getting Started / Making new 3D GUI

Move / Position your GUI

Intermediate

General properties of G3 objects

General methods of G3 objects

Prevent GUI being hidden behind the Player

Prevent GUI being obscured by the surroundings

Advanced

Boost performance by merging parts

Support G3!

If you are interested in G3 expanding beyond a passion project, or if you want to boost G3 along with its development and see more advanced features, please donate!

Donations mean a lot of me, as they are direct proof that I'm going in the right direction. Donating even a dollar would mean so much to not only me but the rest of my family.

ko-fi

Clone this wiki locally