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
 
(One intermediate revision by the same user not shown)
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__
*[[TogglePlayerTag]]
*[[SetPlayerVoiceTone]]
*[[GetPlayerActor]]
*[[GetPlayerSkeletalMeshComponent]]
*[[GetPlayerId]]
*[[SetPlayerPropertyValue]]
*[[GetPlayerPropertyValue]]
*[[SetPlayerRotationRate]]
*[[GetPlayerRotationRate]]
*[[SetPlayerJumpZVelocity]]
*[[GetPlayerJumpZVelocity]]
*[[GetPlayerWeapon]]
*[[GetWeaponType]]
*[[GetPlayerWeaponMuzzleLocation]]
*[[GetPlayerBoneNames]]
*[[GetAllPlayersInSphere]]
*[[GetAllPlayersInBox]]
*[[GetTerrainHeight]]
*[[EnableFirstPersonCamera]]
*[[IsFirstPersonCamera]]
*[[SetControllerOrientedMovement]]
*[[IsValidPlayer]]
*[[GetPlayerName]]
*[[GetStreamedPlayers]]
*[[GetPlayerLocation]]
*[[GetPlayerHeading]]
*[[IsPlayerTalking]]
*[[GetPlayerHealth]]
*[[GetPlayerArmor]]
*[[GetPlayerMovementMode]]
*[[GetPlayerMovementSpeed]]
*[[IsPlayerAiming]]
*[[IsPlayerReloading]]
*[[IsPlayerDead]]
*[[GetPlayerBoneLocation]]
*[[SetPlayerOutline]]
*[[SetPlayerClothingPreset]]
*[[GetPlayerVehicle]]
*[[IsPlayerInVehicle]]
*[[GetPlayerVehicleSeat]]
*[[GetPlayerEquippedWeaponSlot]]
*[[GetPlayerForwardVector]]
*[[GetPlayerRightVector]]
*[[GetPlayerUpVector]]
*[[GetVehicleActor]]
*[[SetPlayerLipMovement]]
*[[IsPlayerPlayingAnimation]]
*[[GetPlayerCount]]
*[[CancelAimImmediately]]

Latest revision as of 14:49, 23 December 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