|
|
(4 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | ==Properties==
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/components/sspherecollider |
− | | + | |
− | {{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|bool|Enabled|[get, set]|Enabled Colliders will collide with other Colliders, disabled Colliders won't.|5=<pre>Space.Host.ExecutingObject.SphereCollider.Enabled = false</pre>|6=<pre>--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)</pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|bool|IsTrigger|[get, set]|Is the collider a trigger?|5=<pre>Space.Host.ExecutingObject.SphereCollider.Enabled = true</pre>|6=<pre>--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)</pre>}}
| + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |