Summary
Attempting to change the name in a description_component to include or be the player’s username causes all clients who are connected to the session games to hard crash.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Stability
Steps to Reproduce
Create a function to get the player’s name:
GetPlayerName <localizes> (Player : player) : message = "{Player}"
Attempt to change an item’s name to the player’s name:
Create a component to attach to the custom item in the prefab editor that
has a function to change the name, call that function when spawning the item from something like a button:
name_changer_component <public> := class <final_super> (component):
UpdateName (Player : player) : void =
if. DescriptionComp := Entity.GetFirstComp[description_component] then:
ItemName := GetPlayerName(Player)
set DescriptionComp.Name = ItemName
#different component/device:
Function (Player : player) : void =
if. SimEntity := Entity.GetSimulationEntity[] then:
CustomItem := #CUSTOM ITEM FILE LOCATION
SimEntity.AddEntities(array. CustomItem)
if. NameChangerComp := CustomItem.GetFirstComp[name_changer_component] then:
NameChangerComp.UpdateName(Player)
# A helper function of mine is used here, ensure you have it
(InEntity:entity).GetFirstComp(component_type:castable_subtype(component))<transacts><decides> : component_type =
(for (I : InEntity.FindDescendantComponents(component_type)){ I })[0]
Expected Result
The custom item’s name changes to the player’s name.
Observed Result
The game of any clients connected to the session hard crashes.
Platform(s)
Xbox Series X (Session)
PC (UEFN)