Ir para o conteúdo principal
Version: latest - a1.73.x ⚖️

Base Pawn

Base class for all Character entities.

🧑‍💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
👪Base Class
This is a Base Class. Base Classes are abstract definitions used to share common methods and events between related child classes, thus you cannot spawn it directly.

Classes that share methods and events from this Base Class: Character, CharacterSimple.

🦠 Functions

ReturnsNameDescription
Attaches a Skeletal Mesh as master pose to this entity
Attaches a Static Mesh to this entity
AI: Makes this Character to follow another actor
of Gets all Skeletal Meshes attached to this entity
of Gets all Static Meshes attached to this entity
Gets the Capsule Size
RotatorGets the Control Rotation
Gets the gravity scale
Gets the base Mesh Asset
VectorGets the Moving To location
Player or Gets the possessing Player
Hides a bone of this Character
Gets if a bone is hidden
Triggers this Character to jump
AI: Makes this Character to walk to the Location
Removes all SkeletalMeshes attached
Removes all StaticMeshes attached
Removes, if it exists, a SkeletalMesh from this entity given its custom ID
Removes, if it exists, a StaticMesh from this enitity given its custom ID
AI: Configures the RVO (Reciprocal Velocity Obstacles) Avoidance system used by the AIs when moving
Sets the Movement Braking Settings of this Character
Sets if this Character is allowed to Crouch and to Prone
Sets if this Character is allowed to Jump
Sets this Character's Capsule size
Changes the Gravity Scale
Sets the velocity of the jump
Sets a Static Mesh Attached location and rotation
Stops an Animation Montage on this character
AI: Stops the movement
UnHide a bone of this Character

AddSkeletalMeshAttached

Spawns and attaches a SkeletalMesh to this entity, the SkeletalMesh must have the same skeleton used by this Actor's mesh, and will follow all animations from it. Uses a custom ID to be used for removing/customizing it afterwards

my_pawn:AddSkeletalMeshAttached(id, skeletal_mesh_path, use_parent_bounds?)
TypeParameterDefaultDescription
id Required parameter Used further for removing or applying material settings on it
skeletal_mesh_path Required parameter Path to SkeletalMesh asset to attach
use_parent_bounds?trueIf true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together

See also RemoveSkeletalMeshAttached.


AddStaticMeshAttached

Spawns and attaches a StaticMesh to this entity in a Socket with a relative location and rotation. Uses a custom ID to be used for removing/customizing it afterwards

my_pawn:AddStaticMeshAttached(id, static_mesh_path, socket?, relative_location?, relative_rotation?, use_parent_bounds?)
TypeParameterDefaultDescription
id Required parameter Unique ID to assign to the StaticMesh
static_mesh_path Required parameter Path to StaticMesh asset to attach
socket?Bone socket to attach to
Vectorrelative_location?Vector(0, 0, 0)Relative location
Rotatorrelative_rotation?Rotator(0, 0, 0)Relative rotation
use_parent_bounds?trueIf true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together

See also SetStaticMeshAttachedTransform, RemoveStaticMeshAttached.


Follow

AI: Makes this Character to follow another actor

Triggers event MoveComplete

my_pawn:Follow(actor, acceptance_radius?, stop_on_succeed?, stop_on_fail?, update_rate?)
TypeParameterDefaultDescription
actor Required parameter Actor to follow
acceptance_radius?50Radius to consider success
stop_on_succeed?falseWhether to stop when reaching the target
stop_on_fail?falseWhether to stop when failed to reach the target
update_rate?0.25How often to recalculate the AI path

See also StopMovement, MoveTo, GetMovingTo, MoveComplete.


GetAllSkeletalMeshAttached

Gets all Skeletal Meshes attached to this entity

— Returns of (the key as the Attached ID, and the value as the Asset Path).

local ret = my_pawn:GetAllSkeletalMeshAttached()

GetAllStaticMeshAttached

Gets all Static Meshes attached to this entity

— Returns of (the key as the Attached ID, and the value as the Asset Path).

local ret = my_pawn:GetAllStaticMeshAttached()

GetCapsuleSize

Gets the Capsule Size

— Returns ().

local ret = my_pawn:GetCapsuleSize()

See also SetCapsuleSize.


GetControlRotation

Gets the Control Rotation

— Returns Rotator.

local ret = my_pawn:GetControlRotation()

GetGravityScale

Gets the gravity scale

— Returns .

local ret = my_pawn:GetGravityScale()

See also SetGravityScale.


GetMesh

Gets the base Mesh Asset

— Returns .

local ret = my_pawn:GetMesh()

GetMovingTo

Gets the Moving To location

— Returns Vector (the moving to location or Vector(0, 0, 0) if not moving).

local ret = my_pawn:GetMovingTo()

GetPlayer

Gets the possessing Player

— Returns Player or .

local ret = my_pawn:GetPlayer()

See also Possess, UnPossess.


HideBone

Hides a bone of this Character.

Check Bone Names List

my_pawn:HideBone(bone_name?)
TypeParameterDefaultDescription
bone_name?Bone to hide

See also UnHideBone, IsBoneHidden.


IsBoneHidden

Gets if a bone is hidden

— Returns (if the bone is hidden).

local ret = my_pawn:IsBoneHidden(bone_name)
TypeParameterDefaultDescription
bone_name Required parameter Bone to check

See also UnHideBone, HideBone.


Jump

Triggers this Character to jump

my_pawn:Jump()

MoveTo

AI: Makes this Character to walk to the Location

Triggers event MoveComplete

my_pawn:MoveTo(location, acceptance_radius?)
TypeParameterDefaultDescription
Vectorlocation Required parameter No description provided
acceptance_radius?50No description provided

See also StopMovement, Follow, GetMovingTo, MoveComplete.


RemoveAllSkeletalMeshesAttached

Removes all SkeletalMeshes attached

my_pawn:RemoveAllSkeletalMeshesAttached()

RemoveAllStaticMeshesAttached

Removes all StaticMeshes attached

my_pawn:RemoveAllStaticMeshesAttached()

RemoveSkeletalMeshAttached

Removes, if it exists, a SkeletalMesh from this entity given its custom ID

my_pawn:RemoveSkeletalMeshAttached(id)
TypeParameterDefaultDescription
id Required parameter Unique ID of the SkeletalMesh to remove

See also AddSkeletalMeshAttached.


RemoveStaticMeshAttached

Removes, if it exists, a StaticMesh from this enitity given its custom ID

my_pawn:RemoveStaticMeshAttached(id)
TypeParameterDefaultDescription
id Required parameter Unique ID of the StaticMesh to remove

See also AddStaticMeshAttached.


SetAIAvoidanceSettings

AI: Configures the RVO (Reciprocal Velocity Obstacles) Avoidance system used by the AIs when moving

my_pawn:SetAIAvoidanceSettings(enabled, avoidance_consideration_Radius?)
TypeParameterDefaultDescription
enabled Required parameter Whether to enable the RVO Avoidance
avoidance_consideration_Radius?300The radius of the circle used to determine the avoidance distance

SetBrakingSettings

Sets the Movement Braking Settings of this Character

my_pawn:SetBrakingSettings(ground_friction?, braking_friction_factor?, braking_walking?, braking_flying?, braking_swimming?, braking_falling?)
TypeParameterDefaultDescription
ground_friction?2No description provided
braking_friction_factor?2No description provided
braking_walking?96No description provided
braking_flying?3000No description provided
braking_swimming?10No description provided
braking_falling?0No description provided

SetCanCrouch

Sets if this Character is allowed to Crouch and to Prone

my_pawn:SetCanCrouch(can_crouch)
TypeParameterDefaultDescription
can_crouch Required parameter No description provided

SetCanJump

Sets if this Character is allowed to Jump

my_pawn:SetCanJump(can_jump)
TypeParameterDefaultDescription
can_jump Required parameter No description provided

SetCapsuleSize

Sets this Character's Capsule size (will affect Camera location and Character's collision)

my_pawn:SetCapsuleSize(radius, half_height)
TypeParameterDefaultDescription
radius Required parameter Default is 42
half_height Required parameter Default is 96

See also GetCapsuleSize.


SetGravityScale

Changes the Gravity Scale of this Character (can be negative)

my_pawn:SetGravityScale(gravity_scale)
TypeParameterDefaultDescription
gravity_scale Required parameter No description provided

See also GetGravityScale.


SetJumpZVelocity

Sets the velocity of the jump

my_pawn:SetJumpZVelocity(jump_z_velocity)
TypeParameterDefaultDescription
jump_z_velocity Required parameter Default is 450

SetStaticMeshAttachedTransform

Sets a Static Mesh Attached location and rotation

my_pawn:SetStaticMeshAttachedTransform(id, relative_location, relative_rotation)
TypeParameterDefaultDescription
id Required parameter Unique ID of the StaticMesh set with AddStaticMeshAttached
Vectorrelative_location Required parameter New relative location
Rotatorrelative_rotation Required parameter New relative rotation

See also AddStaticMeshAttached.


StopAnimation

Stops an Animation Montage on this character

my_pawn:StopAnimation(animation_asset)
TypeParameterDefaultDescription
animation_asset Required parameter No description provided

StopMovement

AI: Stops the movement

Triggers event MoveComplete

my_pawn:StopMovement()

See also Follow, MoveTo, GetMovingTo, MoveComplete.


UnHideBone

UnHide a bone of this Character.

Check Bone Names List

my_pawn:UnHideBone(bone_name)
TypeParameterDefaultDescription
bone_name Required parameter Bone to unhide

See also HideBone, IsBoneHidden.

🚀 Events

NameDescription
When an Animation Montage Notify begins
When an Animation Montage Notify ends
Called when AI reaches it's destination, or when it fails
When Character is possessed by a Player
When Character is unpossessed by a Player

AnimationBeginNotify

When an Animation Montage Notify begins
Pawn.Subscribe("AnimationBeginNotify", function(self, notify_name, animation_name, trigger_begin_time, trigger_end_time)
-- AnimationBeginNotify was called
end)
TypeArgumentDescription
CharacterselfNo description provided
notify_nameNo description provided
animation_nameNo description provided
trigger_begin_timeNo description provided
trigger_end_timeNo description provided

AnimationEndNotify

When an Animation Montage Notify ends
Pawn.Subscribe("AnimationEndNotify", function(self, notify_name, animation_name, trigger_begin_time, trigger_end_time)
-- AnimationEndNotify was called
end)
TypeArgumentDescription
CharacterselfNo description provided
notify_nameNo description provided
animation_nameNo description provided
trigger_begin_timeNo description provided
trigger_end_timeNo description provided

MoveComplete

Called when AI reaches it's destination, or when it fails
Pawn.Subscribe("MoveComplete", function(self, succeeded)
-- MoveComplete was called
end)
TypeArgumentDescription
selfNo description provided
succeededNo description provided

See also StopMovement, MoveTo, Follow, GetMovingTo.


Possess

When Character is possessed by a Player
Pawn.Subscribe("Possess", function(self, player)
-- Possess was called
end)
TypeArgumentDescription
selfNo description provided
PlayerplayerNo description provided

See also UnPossess, GetPlayer.


UnPossess

When Character is unpossessed by a Player
Pawn.Subscribe("UnPossess", function(self, old_player)
-- UnPossess was called
end)
TypeArgumentDescription
selfNo description provided
Playerold_playerNo description provided

See also Possess, GetPlayer.