Passer au contenu principal
Version: latest - a1.64.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
AddSkeletalMeshAttachedAttaches a Skeletal Mesh as master pose to this entity
AddStaticMeshAttachedAttaches a Static Mesh to this entity
FollowAI: Makes this Character to follow another actor
table of stringGetAllSkeletalMeshAttachedGets all Skeletal Meshes attached to this entity
table of stringGetAllStaticMeshAttachedGets all Static Meshes attached to this entity
RotatorGetControlRotationGets the Control Rotation
SkeletalMesh ReferenceGetMeshGets the base Mesh Asset
VectorGetMovingToGets the Moving To location
Player or nilGetPlayerGets the possessing Player
HideBoneHides a bone of this Character
booleanIsBoneHiddenGets if a bone is hidden
JumpTriggers this Character to jump
MoveToAI: Makes this Character to walk to the Location
RemoveAllSkeletalMeshesAttachedRemoves all SkeletalMeshes attached
RemoveAllStaticMeshesAttachedRemoves all StaticMeshes attached
RemoveSkeletalMeshAttachedRemoves, if it exists, a SkeletalMesh from this entity given its custom ID
RemoveStaticMeshAttachedRemoves, if it exists, a StaticMesh from this enitity given its custom ID
SetBrakingSettingsSets the Movement Braking Settings of this Character
SetCanCrouchSets if this Character is allowed to Crouch and to Prone
SetCanJumpSets if this Character is allowed to Jump
SetCapsuleSizeSets this Character's Capsule size
SetJumpZVelocitySets the velocity of the jump
SetStaticMeshAttachedTransformSets a Static Mesh Attached location and rotation
StopAnimationStops an Animation Montage on this character
StopMovementAI: Stops the movement
UnHideBoneUnHide 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
stringid Required parameter Used further for removing or applying material settings on it
SkeletalMesh Referenceskeletal_mesh_path Required parameter Path to SkeletalMesh asset to attach
booleanuse_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
stringid Required parameter Unique ID to assign to the StaticMesh
StaticMesh Referencestatic_mesh_path Required parameter Path to StaticMesh asset to attach
stringsocket?Bone socket to attach to
Vectorrelative_location?Vector(0, 0, 0)Relative location
Rotatorrelative_rotation?Rotator(0, 0, 0)Relative rotation
booleanuse_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
Base Actoractor Required parameter Actor to follow
floatacceptance_radius?50Radius to consider success
booleanstop_on_succeed?falseWhether to stop when reaching the target
booleanstop_on_fail?falseWhether to stop when failed to reach the target
floatupdate_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 table of string (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 table of string (the key as the Attached ID, and the value as the Asset Path).

local ret = my_pawn:GetAllStaticMeshAttached()

GetControlRotation

Gets the Control Rotation

— Returns Rotator.

local ret = my_pawn:GetControlRotation()

GetMesh

Gets the base Mesh Asset

— Returns SkeletalMesh Reference.

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 nil.

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
stringbone_name?Bone to hide

See also UnHideBone, IsBoneHidden.


IsBoneHidden

Gets if a bone is hidden

— Returns boolean (if the bone is hidden).

local ret = my_pawn:IsBoneHidden(bone_name)
TypeParameterDefaultDescription
stringbone_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
floatacceptance_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
stringid 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
stringid Required parameter Unique ID of the StaticMesh to remove

See also AddStaticMeshAttached.


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
floatground_friction?2No description provided
floatbraking_friction_factor?2No description provided
integerbraking_walking?96No description provided
integerbraking_flying?3000No description provided
integerbraking_swimming?10No description provided
integerbraking_falling?0No description provided

SetCanCrouch

Sets if this Character is allowed to Crouch and to Prone

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

SetCanJump

Sets if this Character is allowed to Jump

my_pawn:SetCanJump(can_jump)
TypeParameterDefaultDescription
booleancan_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
integerradius Required parameter Default is 42
integerhalf_height Required parameter Default is 96

SetJumpZVelocity

Sets the velocity of the jump

my_pawn:SetJumpZVelocity(jump_z_velocity)
TypeParameterDefaultDescription
integerjump_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
stringid 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 Referenceanimation_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
stringbone_name Required parameter Bone to unhide

See also HideBone, IsBoneHidden.

🚀 Events

NameDescription
MoveCompleteCalled when AI reaches it's destination, or when it fails
PossessWhen Character is possessed
UnPossessWhen Character is unpossessed

MoveComplete

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

See also StopMovement, MoveTo, Follow, GetMovingTo.


Possess

When Character is possessed
Pawn.Subscribe("Possess", function(self, possesser)
-- Possess was called
end)
TypeArgumentDescription
Base PawnselfNo description provided
PlayerpossesserNo description provided

See also UnPossess, GetPlayer.


UnPossess

When Character is unpossessed
Pawn.Subscribe("UnPossess", function(self, old_possesser)
-- UnPossess was called
end)
TypeArgumentDescription
Base PawnselfNo description provided
Playerold_possesserNo description provided

See also Possess, GetPlayer.