|
|
(2 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | =Members=
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/components/scharactercontroller |
− | | + | |
− | {{ScriptFunction|SVector|ClosestPointOnBounds|(SVector position);|The closest point to the bounding box of the attached collider. This can be used to calculate hit points when applying explosion damage.|5=
| + | |
− | function PrintVector (data)<br>
| + | |
− | Space.Log(data.X)<br>
| + | |
− | Space.Log(data.Y)<br>
| + | |
− | Space.Log(data.Z)<br>
| + | |
− | end<br>
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local newVector = Vector.New(5,5,5)<br>
| + | |
− | local Vectordata = Object.CharacterController.ClosestPointOnBounds(newVector)<br>
| + | |
− | PrintVector(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SVector|ClosestPoint|(SVector position);|The point on the collider that is closest to the specified location.|5=
| + | |
− | function PrintVector (data)<br>
| + | |
− | Space.Log(data.X)<br>
| + | |
− | Space.Log(data.Y)<br>
| + | |
− | Space.Log(data.Z)<br>
| + | |
− | end<br>
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local newVector = Vector.New(5,5,5)<br>
| + | |
− | local Vectordata = Object.CharacterController.ClosestPoint(newVector)<br>
| + | |
− | PrintVector(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|SimpleMove|(SVector speed)|Moves the character with speed.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local newVector = Vector.New(100,0,0)<br>
| + | |
− | local Vectordata = Object.CharacterController.SimpleMove(newVector)<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|int|Move|(SVector motion)|Moves the character with speed.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local newVector = Vector.New(100,0,0)<br>
| + | |
− | local Vectordata = Object.CharacterController.Move(newVector)<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | =Properties=
| + | |
− | | + | |
− | {{ScriptFunction|SVector|Center|{get; set;}|Returns Center Vector value of the Character Controller.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | Space.Log(Object.CharacterController.Center.X)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|DetectCollisions|{get; set;}|Determines whether other rigid bodies or character controllers collide with this character controller (by default this is always enabled).|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.DetectCollisions<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|EnableOverlapRecovery|{get; set;}|Enables or disables overlap recovery.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.enableOverlapRecovery<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|Height|{get; set;}|The height of the character's capsule.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.Height<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|MinMoveDistance|{get; set;}|Gets or sets the minimum move distance of the character controller.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.MinMoveDistance<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|Radius|{get; set;}|The radius of the character's capsule.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.Radius<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|SkinWidth|{get; set;}|The character's collision skin width.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.SkinWidth<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|SlopeLimit|{get; set;}|The character controllers slope limit in degrees.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.SlopeLimit<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|float|StepOffset|{get; set;}|The character controllers step offset in meters.|5=
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local Vectordata = Object.CharacterController.StepOffset<br>
| + | |
− | Space.Log(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SVector|Velocity|{ get; set; }|The current relative velocity of the Character.|5=
| + | |
− | function PrintVector (data)<br>
| + | |
− | Space.Log(data.X)<br>
| + | |
− | Space.Log(data.Y)<br>
| + | |
− | Space.Log(data.Z)<br>
| + | |
− | end<br>
| + | |
− | local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
| + | |
− | local newVector = Vector.New(5,5,5)<br>
| + | |
− | local Vectordata = Object.CharacterController.Velocity<br>
| + | |
− | PrintVector(Vectordata)
| + | |
− | }}
| + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |