SSphereCollider

Index

Properties Index

Property Name

Properties

Center

SVector Center get set

The center of the sphere in the object's local space.

Center = Space.Host.ExecutingObject.SphereCollider.Center
--clicking this object moves it's Sphere Collider's center one unit upwards

thisObject = Space.Host.ExecutingObject

OnClick = function()
center = thisObject.SphereCollider.Center

thisObject.SphereCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)

Radius

float Radius get set

The radius of the sphere measured in the object's local space.

Space.Host.ExecutingObject.SphereCollider.Radius = 2
--clicking this object increments it's Sphere Collider's radius by one unit 

thisObject = Space.Host.ExecutingObject

OnClick = function()

thisObject.SphereCollider.Radius = thisObject.SphereCollider.Radius + 1

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)

Enabled

bool Enabled get set

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

Space.Host.ExecutingObject.SphereCollider.Enabled = false
--clicking this object toggles it's Sphere Collider On/Off

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.SphereCollider.Enabled = not thisObject.SphereCollider.Enabled

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)

IsTrigger

bool IsTrigger get set

Is the collider a trigger?

Space.Host.ExecutingObject.SphereCollider.Enabled = true
--clicking this object toggles it's Sphere Collider between being a Collider vs Trigger Collider

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.SphereCollider.IsTrigger = not thisObject.SphereCollider.IsTrigger

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)

GameObject

SGameObject GameObject get

Property Description

theGameObject = Space.Host.ExecutingObject.SphereCollider.GameObject

Last updated

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.