As title says. When you remove a mesh_comp then add a new one this cannot be in the same tick or it doesn’t work. You need to have a Sleep() and 0.03 seems to be the lowest it would work at.
I would think you could add a mesh_comp to an entity in the same tick if you first removed the old one but apparently not.
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
World Building
Steps to Reproduce
Have a entity and remove the mesh_comp from the entity and add a new one in the same tick
Expected Result
i think if ordered correctly ie remove first then add it should be valid in the same tick
Observed Result
It fails unless you use Sleep(0.03)
Platform(s)
PC
Additional Notes
UpdateMeshComp()<suspends>:void=
if(MeshComp := Entity.GetComponent[mesh_component]):
MeshComp.RemoveFromEntity()
Sleep(0.03) # Need this to work - Without this it doesnt work
if(NewMesh := GetCropStagePrefab(CropType, CurrentStage, Entity)?):
Entity.AddComponents(array{NewMesh})
I feel the main issue is having to use Sleep(0.03) or it never renders but also note sometimes when using Sleep(0.03) it also can be invisible but less likely than using no sleep as its always invisible then.