GetPlayerSkeletalMeshComponent

From Onset Developer Wiki
GetPlayerSkeletalMeshComponent

Type: Function
Context: Client
Introduced: v1.0

Description

Gets the skeletal mesh component of a player.

Syntax

GetPlayerSkeletalMeshComponent(player, ComponentName)

Parameters

  • player
    The player identifier.
  • ComponentName
    Name of which SK component to get. Can be Body, WeaponMesh, Clothing0, Clothing1, Clothing2, Clothing3, Clothing4, Clothing5, Clothing6, Clothing7, Clothing8, Clothing9

Return Value

  • Returns the skeletal mesh component. UnrealLua

Example

AddEvent("OnKeyPress", function(k)
	if k == "1" then
		local SkeletalMeshComponent = GetPlayerSkeletalMeshComponent(GetPlayerId(), "Body")
		SkeletalMeshComponent:SetSkeletalMesh(USkeletalMesh.LoadFromAsset("/Game/CharacterModels/SkeletalMesh/BodyMerged/HZN_CH3D_Normal03_LPR"))
    end
end)

See also