|
|
(3 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | =Static Public Member Functions=
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/types/sjointspring |
− | | + | |
− | {{ScriptFunction|SJointSpring|New|(float spring, float damper, float targetPosition);|Creates a new SJointSpring with the given spring, damper, targetPosition.||5=<pre>Motor= Space.Host.ExecutingObject.HingeJoint.Spring.New(1,2,3)</pre>|6=<pre>--the below script will change all Hinge Joint Spring properties to 0 when clicked
| + | |
− | --[Add "thehingejoint" reference to the Scripting Runtime component]
| + | |
− | thisObject = Space.Host.ExecutingObject
| + | |
− | hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
| + | |
− | | + | |
− | | + | |
− | function OnClickFunction()
| + | |
− | spring = hingejoint.Spring
| + | |
− | hingejoint.Spring = spring .New(0,0,0)
| + | |
− | end
| + | |
− | | + | |
− | thisObject.AddClickable()
| + | |
− | thisObject.Clickable.OnClick(OnClickFunction)</pre>}}
| + | |
− | | + | |
− | | + | |
− | =Public Member Functions=
| + | |
− | {{ScriptFunction|string|ToString|();|Returns this SJointSpring's properties as a string||5=<pre>SpringString = Space.Host.ExecutingObject.HingeJoint.Spring.ToString()</pre>|6=<pre></pre>}}
| + | |
− | | + | |
− | | + | |
− | =Properties=
| + | |
− | | + | |
− | {{ScriptFunction|float|Spring|{ get;set; }|The spring forces used to reach the target position.|5=<pre>SpringSpring= Space.Host.ExecutingObject.HingeJoint.Spring.Spring</pre>|6=<pre></pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|float|Damper|{ get;set; }|The damper force uses to dampen the spring.|5=<pre>SpringDamper= Space.Host.ExecutingObject.HingeJoint.Spring.Damper</pre>|6=<pre></pre>}}
| + | |
− | | + | |
− | {{ScriptFunction|float|TargetPosition|{ get;set; }|The target position the joint attempts to reach.|5=<pre>SpringTargetPosition = Space.Host.ExecutingObject.HingeJoint.Spring.TargetPosition</pre>|6=<pre></pre>}}
| + | |
− | | + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |