SBoxCollider

Index

Properties Index

Property Name

SVector Center get set

SVector Size get set

bool Enabled get set

bool IsTrigger get set

Properties

Center

SVector Center get set

The position of the center of the Box Collider.

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

thisObject = Space.Host.ExecutingObject

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

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

end

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

Size

SVector Size get set

The size of the box.

Size= Space.Host.ExecutingObject.BoxCollider.Size
--clicking this object increases it's Box Collider's size by one unit

thisObject = Space.Host.ExecutingObject

OnClick = function()
size = thisObject.BoxCollider.Size

thisObject.BoxCollider.Size = Vector.New(size.X + 1,size.Y + 1, size.Z + 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.BoxCollider.Enabled = false
--clicking this object toggles it's Box Collider On/Off

thisObject = Space.Host.ExecutingObject

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

end

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

IsTrigger

bool IsTrigger get set

Is the collider a trigger?

Space.Host.ExecutingObject.BoxCollider.Enabled = true
--clicking this object toggles it's Box Collider between being a Collider and Trigger Collider

thisObject = Space.Host.ExecutingObject

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

end

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

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

theGameObject = Space.Host.ExecutingObject.BoxCollider.GameObject

Last updated

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