(Created page with "=Static Public Member Functions= {{ScriptFunction|SJointSpring|New|(float spring, float damper, float targetPosition);|Creates a new SJointSpring with the given spring, dampe...") |
|||
Line 1: | Line 1: | ||
=Static Public Member Functions= | =Static Public Member Functions= | ||
− | {{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></pre>}} | + | {{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 = limits.New(0,0,0) | ||
+ | end | ||
+ | |||
+ | thisObject.AddClickable() | ||
+ | thisObject.Clickable.OnClick(OnClickFunction)</pre>}} | ||
Creates a new SJointSpring with the given spring, damper, targetPosition.
Motor= Space.Host.ExecutingObject.HingeJoint.Spring.New(1,2,3)
--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 = limits.New(0,0,0) end thisObject.AddClickable() thisObject.Clickable.OnClick(OnClickFunction)
Returns this SJointSpring's properties as a string
SpringString = Space.Host.ExecutingObject.HingeJoint.Spring.ToString()
The spring forces used to reach the target position.
SpringSpring= Space.Host.ExecutingObject.HingeJoint.Spring.Spring
The damper force uses to dampen the spring.
SpringDamper= Space.Host.ExecutingObject.HingeJoint.Spring.Damper
The target position the joint attempts to reach.
SpringTargetPosition = Space.Host.ExecutingObject.HingeJoint.Spring.TargetPosition
|