Hi,
I’m seeing unexpected behavior with EventActorOnClicked
and GetHitResultUnderCursorByChannel
when using a custom project trace (collision) channel and Instanced Static Meshes. From what I can tell, this might be a bug in the engine.
The setup is as follows:
- Create an
Actor
blueprint and add aInstancedStaticMesh
Component to it which uses a single quad as a mesh (a map tile in my case). - Create a custom trace (collision) channel in the project settings with Default Response
Ignore
.
3. Using Blueprint scripting, build a couple of Instanced Static Meshes with a For loop and assign them to
Block
on the custom channel.
4. Use a Player Controller with mouse input activated and use
GetHitResultUnderCursorByChannel
to test for collisions with the DefaultSceneRoot
of the blueprint instance (i.e. the parent element of the mesh instances).
5. Trigger the test in step 4 using
EventActorOnClicked
.
Expected behavior:
Whenever I click any of the instanced meshes, EventActorOnClicked
should fire and run GetHitResultUnderCursorByChannel
which should have a Return Value
of true
, and I should then be able to obtain the Hit Actor
and Location
of the Hit
. If the mouse is not over an instanced mesh when clicking, EventActorOnClicked
should not fire.
Actual observed behavior:
Hit detection for all instances works correctly as expected except for the first InstancedStaticMesh
that was created. For this first instance EventActorOnClicked
fires but the Return Value
of GetHitResultUnderCursorByChannel
is false
. Using HitActor
then fails with the following error message:
PIE:Error: Error Accessed None 'CallFunc_BreakHitResult_HitActor' from node Return Node in graph 'MyBlueprintFunctionName' in blueprint Level
Can anyone confirm if this is a bug or point me to whatever I am missing?
Thanks.