In Moonsharp, static members of a type are accessed through an instance of that type rather than the class name. For types that can be constructed (like structs), you must create an instance first. For reference types (classes) that cannot be constructed in ModScript, the environment provides pre-instantiated global objects for commonly used Unity types.
-- Example: Accessing Vector2.Distance (C#) in ModScript
local dummyVector2 = createInstance("Vector2")
local pointA, pointB = createInstance("Vector2"), createInstance("Vector2")
pointA.x, pointA.y = 6, 9
pointB.x, pointB.y = 4, 2
-- Access static method Distance via the dummy instance
local distance = dummyVector2.Distance(pointA, pointB)
print("distance: ", distance)