LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

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

On this page
  • Index
  • Functions Index
  • Properties Index
  • Functions
  • ToString
  • New
  • Properties
  • Spring
  • Damper
  • TargetPosition

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Types

SJointSpring

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

ToString

override string ToString ()

Returns this SJointSpring's properties as a string

Parameter
Type
Description

SpringString = Space.Host.ExecutingObject.HingeJoint.Spring.ToString()
--the below script will make a UI Text element display this GameObjects Hinge Joint Spring properties
--[Add "thetext" and "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
text = Space.Host.GetReference("thetext").UIText
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint


function OnUpdateFunction()
spring = hingejoint.Spring
text.Text = spring.ToString()
end


thisObject.OnUpdate(OnUpdateFunction)

New

static SJointSpring New (float spring, float damper, float targetPosition)

Creates a new SJointSpring with the given spring, damper, targetPosition.

Parameter
Type
Description

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 = spring .New(0,0,0)
end

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

Properties

Spring

float Springget

The spring forces used to reach the target position.

SpringSpring= Space.Host.ExecutingObject.HingeJoint.Spring.Spring
--the below script will make a slider change a Hinge Joint Spring Spring property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint


OVC = function()
spring = hingejoint.Spring
spring.Spring = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring= spring
end

slider.OnValueChanged(OVC)

Damper

float Damperget

The damper force uses to dampen the spring.

SpringDamper= Space.Host.ExecutingObject.HingeJoint.Spring.Damper
--the below script will make a slider change a Hinge Joint Spring Damper property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint


OVC = function()
spring = hingejoint.Spring
spring.Damper = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring = spring
end

slider.OnValueChanged(OVC)

TargetPosition

float TargetPositionget

The target position the joint attempts to reach.

SpringTargetPosition = Space.Host.ExecutingObject.HingeJoint.Spring.TargetPosition
--the below script will make a slider change a Hinge Joint Spring TargetPosition property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint


OVC = function()
spring = hingejoint.Spring
spring.TargetPosition = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring = spring
end

slider.OnValueChanged(OVC)
PreviousSJointMotorNextSLandmark

Last updated 2 years ago

Was this helpful?

override string ()

static SJointSpring (float spring, float damper, float targetPosition)

float get

float get

float get

ToString
New
Spring
Damper
TargetPosition