GetPhysicsActorGroup

Definition

string GetPhysicsActorGroup(string physicsActorName)

Description

This function receives the name of physics actor and returns its type as string.

Parameters

physicsActorName
Specifies the name of the physics actor belonging to the prefab instance.

Return Value

This function returns the type of physics actor as one of the following string values:

“KINEMATIC”
Kinematic is a dynamic actor that can ignore some rules of physics, and its rotation and translation is controlled by prefab instance.

“DYNAMIC”
A dynamic actor has its position and rotation updated by the physics simulation and controls the translation and rotation of its prefab instance.

“TRIGGER”
Triggers allow colliders to perform overlap tests.

“STATIC”
Static actor is immovable by the physics simulation.

“GROUND”
Default physics ground plane.

Example

function OnTriggerEnter(otherActorName)

    if GetPhysicsActorGroup(otherActorName) == "KINEMATIC" then PrintConsole("\nKinematic Actor")

    elseif GetPhysicsActorGroup(otherActorName) == "DYNAMIC" then PrintConsole("\nDynamic Actor")

    end

end

function OnTriggerStay(otherActorName)

end

function OnTriggerExit(otherActorName)

end
Assume that this script is attached to a trigger. In this case, whenever a prefab instance that has a kinematic actor is entered into this trigger, a message titled “Kinematic Actor”  will be displayed on the console. Otherwise, if the prefab instance that has a dynamic actor is entered into this trigger, a message titled “Dynamic Actor” will be displayed in the console.
adminGetPhysicsActorGroup