GetPlayerSkeletalMeshComponent: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Gets the skeletal mesh component of a player.}} {{FuncSyntax|GetPlayerSkeletalMeshComponent(player, ComponentName)}} {{FuncPa..."
 
No edit summary
Line 7: Line 7:
{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|player|The player identifier.}}
{{FuncParam|player|The player identifier.}}
{{FuncParam|ComponentName|Name of which SK component to get. Can be '''Body''', '''WeaponMesh''', '''Clothing0''', '''Clothing1''', '''Clothing2''', '''Clothing3''', '''Clothing4''', '''Clothing5'''}}
{{FuncParam|ComponentName|Name of which SK component to get. Can be '''Body''', '''WeaponMesh''', '''Clothing0''', '''Clothing1''', '''Clothing2''', '''Clothing3''', '''Clothing4''', '''Clothing5''', '''Clothing6''', '''Clothing7''', '''Clothing8''', '''Clothing9'''}}


{{FuncReturnValue|Returns the skeletal mesh component. [[UnrealLua]]}}
{{FuncReturnValue|Returns the skeletal mesh component. [[UnrealLua]]}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
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)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
__EDIT_ME__

Revision as of 19:01, 30 August 2020

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

__EDIT_ME__