Summary
When a var mesh_comonent is used for EntityEnteredEvent and EntityExitedEvent, these events stop getting called when the var mesh_component is changed unless the events are looped however, when these are looped, the event gets called too much and logic is broken
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
Create this setup:
if. var Mesh : mesh_component = E.GetComponent[mesh_component] then:
Mesh.EntityEnteredEvent.Subscribe(Function1)
Mesh.EntityExitedEvent.Subscribe(Function2)
NewEntity := entity{}
MeshComp := NEWMESH:
Entity := NewEntity, Material := AMaterial
set CompArray = array {MeshComp}
ChildEntities : []component = E.GetComponents()
for (Index := 0..ChildEntities.Length -1):
if. Child := ChildEntities[Index]
then. Child.RemoveFromEntity()
E.AddComponents(CompArray)
SpawnedMeshComp := E.FindDescendantComponents(mesh_component)
for (MeshComponent : SpawnedMeshComp):
set SpawnedMesh = MeshComponent
Expected Result
The subscribable EntityEnteredEvent and EntityExitedEvent events continue to fire even after the mesh is changed from its original
Observed Result
The events are not fired after the mesh is changed
Platform(s)
Any
Additional Notes
looping the events does get them to update but this can’t be used as the event ends up being fired too many times