Below are some example scripts that might be useful for learning how Artspark functions and also to save time on your own projects!
Scripting
- Script Lifecycle
- Examples
- Built-In Functions
- Script Specific
- firstRun
- self
- setUID
- getUID
- setDictString
- getDictString
- clearDictStrings
- setDictNumber
- getDictNumber
- clearDictNumbers
- setDictBool
- getDictBool
- clearDictBools
- listCollisions
- clearColliders
- listTriggers
- clearTriggers
- replaceLua
- runLua
- checkLuaVar
- runLuaFunction
- runInterval
- stopInterval
- haveComponent
- sendGlobalMessage
- addGlobalScript
- runGlobalScript
- deleteGlobalScript
- addToGlobalGroup
- removeFromGlobalGroup
- getGlobalGroups
- runLuaOnGlobalGroup
- destroyGlobalGroup
- Object Data
- list
- count
- storeSelf
- tryStore
- storeCollision
- storeTrigger
- findChild
- storeParent
- setParent
- nullParent
- getData
- storedIndexOf
- findWithTag
- findWithName
- findUIDInScene
- pushState
- popState
- clearStates
- clearAllStates
- getStored
- getPos
- getX
- getY
- getZ
- getEuler
- getEulerX
- getEulerY
- getEulerZ
- getScale
- getScaleX
- getScaleY
- getScaleZ
- getQuaternion
- setQuaternion
- getForward
- getRight
- getStoredName
- getStoredTag
- getStoredCustomName
- setStoredName
- setStoredTag
- setStoredCustomName
- setLayer
- getLayer
- setAllTags
- setStoredActive
- setAllActive
- createObject
- createAsset
- cloneObject
- deleteStored
- clearNullStored
- clearStored
- destroyStored
- destroyAll
- GameState
- GoToEditor
- GoLevel
- mergeLevel
- downloadZip
- createGlobalMaterial
- deleteGlobalMaterial
- quitApp
- SetLoadTime
- GetLoadTime
- LevelLoaded
- GetAssetLevels
- GoAssetLevel
- setGlobalInt
- globalInt
- deleteInt
- setGlobalStr
- globalStr
- deleteStr
- setGlobalFloat
- globalFloat
- deleteFloat
- setGlobalBool
- globalBool
- deleteBool
- clearGlobals
- setPlayerEnabled
- setPlayerHidden
- playerEnabled
- playerHidden
- setPlayerFly
- getPlayerFly
- setPlayerColor
- getPlayerColor
- thirdPerson
- thirdPersonMouse
- firstPerson
- firstPersonFly
- switchLookButton
- setTimeScale
- timeScale
- setGravityDir
- gravityDir
- showTerrain
- loadTerrainHeightmap
- setSunAngle
- getSunAngle
- enableShadows
- setSunShadowStrength
- getSunShadowStrength
- listFiles
- saveTextLine
- saveTextLines
- loadTextLine
- loadTextLines
- enableFog
- getFog
- setFogColor
- getFogColor
- setFogStart
- getFogStart
- setFogEnd
- getFogEnd
- Transforms
- Math
- addVector3
- addVector2
- distVector3
- distVector2
- diffVector3
- diffVector2
- angToPoint
- dirToAngle
- radToDeg
- degToRad
- scaleVector3
- scaleVector2
- roundToDP
- lerp
- lerpVector
- qarp
- qarpVector
- checkSphereTouch
- inBox
- getDT
- getScreenWidth
- getScreenHeight
- random
- noise
- noise2D
- noise3D
- fbmNoise
- fbmNoise2D
- fbmNoise3D
- pick
- isNull
- notNull
- DateTime
- Text
- split
- getElement
- replace
- substr
- divideString
- multiplyString
- joinString
- toBase64
- base64ToString
- floatingText
- set3DText
- set3DTextScale
- set3DTextOffset
- set3DTextEuler
- set3DTextSize
- set3DTextColor
- reset3DTextAngle
- get3DText
- get3DTextOffset
- string get3DTextEuler
- get3DTextColor
- get3DTextSize
- loadTextWeb
- loadWebBytes
- Input
- Video
- Audio
- Lights
- Camera
- Mesh
- getMeshColor
- setMeshColor
- getMeshEnabled
- enableMesh
- reverseNormals
- addCollider
- boxCollider
- removeCollider
- createObjChild
- loadGLTF
- colorGLTF
- useGlobalMaterial
- modifyMaterialFloat
- loadTexture
- textureScale
- scaleTexture
- textureOffset
- offsetTexture
- setMeshShadow
- getMeshShadow
- setMeshReceiveShadow
- getMeshReceiveShadow
- isOnCamera
- Sprite
- Particles
- particlesPlaying
- clearParticles
- stopParticles
- playParticles
- setParticleRate
- getParticleRate
- setParticleLife
- getParticleLife
- setParticleSpeed
- getParticleSpeed
- setParticleGravity
- getParticleGravity
- setParticleConeShape
- setParticleTexture
- setParticleMesh
- setParticleColor
- getParticleColor
- setParticleSize
- getParticleSize
- setParticleRotation
- getParticleRotation
- Drawing
- clearLine
- addLinePoint
- setLinePoint
- removeLinePoint
- getLinePointTotal
- blurCamera
- setTrailTime
- getTrailTime
- setTrailTexture
- setTrailTextureStretch
- setTrailColor
- getTrailColor
- setTrailSize
- getTrailSize
- createSky
- paintDecal
- setDecalGFX
- setDecalColor
- setDecalSize
- setDecalAngle
- decalRandomColor
- decalRandomAngle
- eraseDecal
- toColor
- Shapes
- Accessories
- addAccessory
- accessoryExists
- listAccessories
- deleteAccessory
- deleteAllAccessories
- setAccessoryTexture
- accessoryTexture
- setAccessoryLit
- accessoryLit
- setAccessoryShadows
- accessoryShadows
- setAccessoryStartPos
- accesssoryStartPos
- setAccessoryStartEuler
- accesssoryStartEuler
- setAccessoryStartScale
- accesssoryStartScale
- setAccessoryOffsetPos
- accessoryOffsetPos
- setAccessoryOffsetEuler
- accessoryOffsetEuler
- setAccessoryOffsetScale
- accessoryOffsetScale
- setAccessoryColor
- accessoryColor
- setAccessoryVisible
- accessoryVisible
- setAccessoryBacksideMirror
- accessoryBacksideMirror
- accessoryRealPos
- accessoryRealEuler
- accessoryParentTo
- getAccessoryParent
- accessoryUnparent
- accessoryCopyFrom
- accessoryCopyTo
- Web
- VR
- isVR
- parentToHand
- getHandPos
- getHandEuler
- buttonVR
- triggerVR
- thumbstickVR
- setHandColliderOn
- handColliderOn
- setHandsVisible
- getHandsVisible
- setBodyVisible
- getBodyVisible
- setGrabbable
- isGrabbable
- setGrabbed
- isGrabbed
- grabHand
- setVRLeftHanded
- getVRLeftHanded
- enableDefaultVRGrab
- getDefaultVRGrab
- snapTurnVR
- smoothTurnVR
- noTurnVR
- setVRTeleport
- getVRTeleport
- setVRTeleButton
- getVRTeleButton
- Animator
- Rigidbody
- Collision
- Path System
- makeWaypoint
- clearWaypoint
- waypointWait
- waypointScript
- followPath
- forceWaypoint
- followerStop
- followerNextPoint
- followerForward
- followerMoveSpd
- followerForceAng
- followerWaitTime
- followerJoinNearest
- followerJoinFurthest
- followerCurrPath
- followerCurrPoint
- followerWarpPoint
- followRandomPath
- followerRandomPath
- Timers
- Actions
- Runtime Gizmos
- XML
- Debug