Must use a Sleep(0.03) when changing a mesh_component on an entity or it will not update visually

Summary

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})

FORT-1051933 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.

Tested after todays update and its still invisible

On the right is using the Sleep(0.03) and on the left is using no sleep clearly something is wrong.

When i go away and back everything renders correctly again

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.

Even with the Sleep(0.03) it sometimes doesn’t render

1 Like