Line 1: | Line 1: | ||
==Properties== | ==Properties== | ||
− | {{ScriptFunction|SVector|Center|[get, set]|The center of the sphere in the object's local space.|5=<pre>Center = Space.Host.ExecutingObject.SphereCollider.Center</pre>|6=<pre></pre>}} | + | {{ScriptFunction|SVector|Center|[get, set]|The center of the sphere in the object's local space.|5=<pre>Center = Space.Host.ExecutingObject.SphereCollider.Center</pre>|6=<pre>--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)</pre>}} | ||
{{ScriptFunction|SVector|Size|[get, set]|The size of the sphere.|5=<pre>Size= Space.Host.ExecutingObject.SphereCollider.Size</pre>|6=<pre></pre>}} | {{ScriptFunction|SVector|Size|[get, set]|The size of the sphere.|5=<pre>Size= Space.Host.ExecutingObject.SphereCollider.Size</pre>|6=<pre></pre>}} |
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)
The size of the sphere.
Size= Space.Host.ExecutingObject.SphereCollider.Size
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)
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)
|