HPlayer
/// tip
HPlayer is a Controller so it inherits all functions from Controller
///
Functionsโ
GetControlledCharacterโ
Retrieves the character currently controlled by this player
- returns:
APawn
local character = HPlayer:GetControlledCharacter()
GetCameraLocationโ
Returns the camera's world location
- returns:
Vector
local cameraLocation = HPlayer:GetCameraLocation()
GetCameraRotationโ
Returns the camera's world rotation
- returns:
FRotator
local cameraRotation = HPlayer:GetCameraRotation()
GetCameraArmLengthโ
Returns the spring arm length, if any
- returns:
number|nil
local cameraArmLength = HPlayer:GetCameraArmLength()
StartCameraFadeโ
Starts a fade effect on the camera
- FromAlpha
number - ToAlpha
number - Duration
number - Color
LinearColor - bShouldFadeAudio
boolean - bHoldWhenFinished
boolean
HPlayer:StartCameraFade()
SetManualCameraFadeโ
Applies a constant fade at a given opacity
- InFadeAmount
number - Color
LinearColor - bInFadeAudio
boolean
HPlayer:SetManualCameraFade()
StopCameraFadeโ
Stops any active fade effect on the camera
HPlayer:StopCameraFade()
SetCameraLocationโ
Moves the spring arm to a new location
- NewLocation
Vector - bSweep
boolean - bTeleport
boolean
HPlayer:SetCameraLocation()
SetCameraRotationโ
Rotates the spring arm in world space
- NewRotation
Rotator - bSweep
boolean - bTeleport
boolean
HPlayer:SetCameraRotation()
TranslateCameraToโ
Interpolates the camera's location
- Target
Vector - DeltaTime
number - InterpSpeed
number
HPlayer:TranslateCameraTo()
SetCameraSocketOffsetโ
Sets the camera's socket offset (end of spring arm)
- Offset
Vector
HPlayer:SetCameraSocketOffset()
SetCameraArmLengthโ
Sets the arm length for the spring arm
- Length
number - bSkipLerp
boolean
HPlayer:SetCameraArmLength()
AttachCameraToโ
Attaches the camera to another scene component
- InParent
USceneComponent - SocketOffset
Vector - BlendSpeed
number - returns:
boolean
local wasAttached = HPlayer:AttachCameraTo()
ResetCameraโ
Resets the camera to its default state
HPlayer:ResetCamera()
RotateCameraToโ
Smoothly rotates the playerโs view
- Rotation
Rotator - Time
number - BlendSpeed
number
HPlayer:RotateCameraTo()
SetValueโ
Stores a custom value
- key
any - value
any - returns:
boolean
local value = HPlayer:SetValue()
GetValueโ
Retrieves a stored custom value
- key
any - returns: any
local value = HPlayer:GetValue()
GetNameโ
Returns the player's name
- returns:
string
local name = HPlayer:GetName()
GetPingโ
Returns the playerโs ping
- returns:
number
local ping = HPlayer:GetPing()
IsLocalPlayerโ
Checks if this is the local player
- returns:
boolean
local isLocal = HPlayer:IsLocalPlayer()
GiveItemByKeyโ
Grants an item to the player
- key
string: Registered item key - returns:
ULyraInventoryItemInstance|nil
local giveItem = HPlayer:GiveItemByKey()
RemoveItemByKeyโ
Removes an item by key
- key
string: Registered item key - returns:
boolean
local removeItem = HPlayer:RemoveItemByKey()
ClearInventoryโ
Clears the playerโs inventory
HPlayer:ClearInventory()
GetAllโ
Returns all active players
- returns:
table
local players = HPlayer:GetAll()
GetByIndexโ
Gets a player by controller reference
- Controller
APlayerController - returns:
HPlayer
local player = HPlayer:GetByIndex()
GetCountโ
Returns the number of tracked players
- returns:
number
local playerCount = HPlayer:GetCount()
JoinVoiceChannelโ
Joins particular voice channel id. Only callable by the server/host.
- InChannelId
number
HPlayer:JoinVoiceChannel()
LeaveVoiceChannelโ
Leaves particular voice channel id. Only callable by the server/host.
- InChannelId
number
HPlayer:LeaveVoiceChannel()
IsInVoiceChannelโ
Checks if player is present in a provided voice channel. Only callable by the server/host.
- InChannelId
number - returns:
boolean
local isInVoiceChannel = HPlayer:IsInVoiceChannel()
MuteInVoiceChannelโ
Mutes this player in a particular voice channel. The player can't talk, but is still able to hear others. Only callable by the server/host.
- InChannelId
number
HPlayer:MuteInVoiceChannel()
UnmuteInVoiceChannelโ
Unmutes this player in a particular voice channel. Only callable by the server/host.
- InChannelId
number
HPlayer:UnmuteInVoiceChannel()
IsMutedInVoiceChannelโ
Checks if player is muted inside a particular voice channel. Only callable by the server/host.
- InChannelId
number - returns:
boolean
local isMuted = HPlayer:IsMutedInVoiceChannel()
MuteForOtherPlayerโ
Mutes this player for another player. The other player won't be able to hear this player. Only callable by the server/host.
- InOtherPlayer
APlayerState
HPlayer:MuteForOtherPlayer()
UnmuteForOtherPlayerโ
Unmutes this player for another player. Only callable by the server/host.
- InOtherPlayer
APlayerState
HPlayer:UnmuteForOtherPlayer()
IsMutedForOtherPlayerโ
Checks if player is muted for another player. Only callable by the server/host.
- InOtherPlayer
APlayerState - returns:
boolean
local isMuted = HPlayer:IsMutedForOtherPlayer()
GetVoiceChannelsโ
Returns all voice channel ids that the player belongs to. Only callable by the server/host.
- returns:
table
local channelIds = HPlayer:GetVoiceChannels()
IsTalkingโ
Checks if the player is currently talking. Only callable by the local player.
- returns:
boolean
local isTalking = HPlayer:IsTalking()
GetVoiceAmplitudeโ
Returns current amplitude of the voice during talking. Only callable by the local player.
- returns:
number
local amplitude = HPlayer:GetVoiceAmplitude()
SetMicNoiseGateThresholdโ
Sets threshold at which the voice noise gate cuts off the voice. Only callable by the local player.
- InThreshold
number
HPlayer:SetMicNoiseGateThreshold()
SetMicSilenceDetectionThresholdโ
Sets threshold at which the voice system interprets our voice as "silence". When the silence is detected, no information about the audio will be sent. Only callable by the local player.
- InThreshold
number
HPlayer:SetMicSilenceDetectionThreshold()
GetMicNoiseGateThresholdโ
Returns threshold at which the voice noise gate cuts off the voice. Only callable by the local player.
- returns:
number
local threshold = HPlayer:GetMicNoiseGateThreshold()
GetMicSilenceDetectionThresholdโ
Returns threshold at which the voice system interprets our voice as "silence". When the silence is detected. Only callable by the local player.
- returns:
number
local threshold = HPlayer:GetMicSilenceDetectionThreshold()