wiki.sine.space | sinespace

Scripting/SCharacterController

From wiki.sine.space
Revision as of 06:54, 12 January 2021 by Edisonwu (Talk | contribs) (Created page with "=Members= {{ScriptFunction|SVector|ClosestPointOnBounds|(SVector position);|The closest point to the bounding box of the attached collider. This can be used to calculate hit...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Members

ClosestPointOnBounds

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.

function PrintVector (data)

    Space.Log(data.X)
    Space.Log(data.Y)
    Space.Log(data.Z)
end
local Object = Space.Scene.Find("SCRIPT_OBJECT")
local newVector = Vector.New(5,5,5)
local Vectordata = Object.CharacterController.ClosestPointOnBounds(newVector)

PrintVector(Vectordata)


ClosestPoint

SVector ClosestPoint (SVector position);

The point on the collider that is closest to the specified location.

function PrintVector (data)

    Space.Log(data.X)
    Space.Log(data.Y)
    Space.Log(data.Z)
end
local Object = Space.Scene.Find("SCRIPT_OBJECT")
local newVector = Vector.New(5,5,5)

local Vectordata = Object.CharacterController.ClosestPoint(newVector)
PrintVector(Vectordata)


SimpleMove

bool SimpleMove (SVector speed)

Moves the character with speed.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local newVector = Vector.New(100,0,0)
local Vectordata = Object.CharacterController.SimpleMove(newVector)

Space.Log(Vectordata)


Move

int Move (SVector motion)

Moves the character with speed.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local newVector = Vector.New(100,0,0)
local Vectordata = Object.CharacterController.Move(newVector)

Space.Log(Vectordata)


Properties

Center

SVector Center {get; set;}

Returns Center Vector value of the Character Controller.

local Object = Space.Scene.Find("SCRIPT_OBJECT")
Space.Log(Object.CharacterController.Center.X)


DetectCollisions

bool DetectCollisions {get; set;}

Determines whether other rigid bodies or character controllers collide with this character controller (by default this is always enabled).

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.DetectCollisions

Space.Log(Vectordata)


EnableOverlapRecovery

bool EnableOverlapRecovery {get; set;}

Enables or disables overlap recovery.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.enableOverlapRecovery

Space.Log(Vectordata)


Height

float Height {get; set;}

The height of the character's capsule.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.Height

Space.Log(Vectordata)


MinMoveDistance

float MinMoveDistance {get; set;}

Gets or sets the minimum move distance of the character controller.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.MinMoveDistance

Space.Log(Vectordata)


Radius

float Radius {get; set;}

The radius of the character's capsule.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.Radius

Space.Log(Vectordata)


SkinWidth

float SkinWidth {get; set;}

The character's collision skin width.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.SkinWidth

Space.Log(Vectordata)


SlopeLimit

float SlopeLimit {get; set;}

The character controllers slope limit in degrees.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.SlopeLimit

Space.Log(Vectordata)


StepOffset

float StepOffset {get; set;}

The character controllers step offset in meters.

local Object = Space.Scene.Find("SCRIPT_OBJECT")

local Vectordata = Object.CharacterController.StepOffset

Space.Log(Vectordata)


Velocity

SVector Velocity { get; set; }

The current relative velocity of the Character.

function PrintVector (data)

    Space.Log(data.X)
    Space.Log(data.Y)
    Space.Log(data.Z)
end
local Object = Space.Scene.Find("SCRIPT_OBJECT")
local newVector = Vector.New(5,5,5)
local Vectordata = Object.CharacterController.Velocity

PrintVector(Vectordata)