I’m using Scene Graph Verse and testing mesh_component.EntityEnteredEvent with the same code on two different meshes:
-
a native UEFN Cube
-
a custom Static Mesh capsule created in UEFN’s Modeling Mode.
The code works perfectly with the native Cube, but with my custom capsuleSM the EntityEnteredEvent is never fired.
I also confirmed that the mesh component is being found correctly in code, so the issue does not seem to be in the Verse logic itself.
What the code does
When one target entity touches another, the target should move to a new position to avoid overlapping the other entity. This is part of an aim-training mode where targets must respawn in a new location when they overlap.
The expected behavior is:
-
entity A touches entity B
-
EntityEnteredEventfires -
the target runs
ChangeHittedPosition() -
the target is repositioned so it does not overlap another target
What is happening
-
The code works with the native UEFN Cube
-
The same code does not work with my custom Static Mesh
capsuleSM -
EntityEnteredEventnever fires on the custom mesh -
The mesh component is found correctly in code
-
The
mesh_componentsettings are already enabled:-
Enabled = true -
Collidable = true -
Queryable = true -
Visible = true
-
Code used
verse fortshoot_colision_vcomponent
using { /Verse.org }
using { /Verse.org/Native }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/BasicShapes }
fortshoot_colision_vcomponent<public> := class<final_super>(component):
OnBeginSimulation<override>():void =
(super:)OnBeginSimulation()
if (MeshComponent := Entity.GetComponent[mesh_component]):
Print("boxmesh_colision_vcomponent: mesh found")
MeshComponent.EntityEnteredEvent.Subscribe(OnMeshEntered)
else:
Print("boxmesh_colision_vcomponent: mesh not found")
OnMeshEntered(OtherEntity:entity):void =
#The print below no longer runs on the custom mesh. The code works fine with the native UEFN 'cube' mesh, so the problem isn't here on verse
Print("boxmesh_colision_vcomponent: EntityEnteredEvent shooted")
if (ShotgunComp := Entity.GetComponent[fortnite_shotgun_targetvcomponent]):
Print("boxmesh_colision_vcomponent: shotgun component found")
ShotgunComp.ChangeHittedPosition()
else:
Print("boxmesh_colision_vcomponent: shotgun component not found")
verse fortnite_shotgun_targetvcomponent
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /Verse.org/SpatialMath }
using { /Verse.org/SceneGraph }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random }
using { /UnrealEngine.com/BasicShapes }
fortnite_shotgun_targetvcomponent<public> := class<final_super>(component):
@editable
var MaxTranslation<public>:float = 200.0
OnBeginSimulation<override>():void =
(super:)OnBeginSimulation()
ChangeHittedPosition():void=
HitEntity := Self.Entity
if(Parent := HitEntity.GetParent[]):
ParentTransform := Parent.GetGlobalTransform()
RandomLeft := GetRandomFloat(-MaxTranslation, MaxTranslation)
RandomUp := GetRandomFloat(-MaxTranslation, MaxTranslation)
NewTranslation := ParentTransform.Translation + (/Verse.org/SpatialMath:)vector3{Forward := 0.0, Left := RandomLeft, Up := RandomUp}
NewTransform := (/Verse.org/SpatialMath:)transform{
Translation := NewTranslation
Rotation := ParentTransform.Rotation
Scale := ParentTransform.Scale
}
HitEntity.SetGlobalTransform(NewTransform)
What I need to know
I want to understand the exact configuration used by the native UEFN Cube so I can make my custom capsuleSM behave the same way.
Specifically:
-
which Static Mesh Editor collision settings are required
-
which settings allow
EntityEnteredEventto fire correctly on a custom Static Mesh
In short: the same code works on the native Cube, so I need to know how to configure my custom capsuleSM so it produces the same overlap behavior and EntityEnteredEvent starts firing correctly.


