Actor Set up: I have an actor class that contains a Capsule Collision (for when the actor is getting hit) and a Box Collision that spins while attacking (for when the actor is hitting something else). I have an on component hit event that should be triggering whenever the box collision collides with something else. When that event triggers, the box collision should stop spinning. I also have an event hit going whenever something collides into the capsule collision just for testing purposes.
Physics Set Up: Both the capsule collision and the box collision are set to Simulation Generates Hit Events, Generate Overlap Events and have a Pawn collision preset. Neither have simulate physics checked. There is also a Shape_Sphere that simulates physics, is set to Simulation Generates Hit events, is not set to Generate Overlap Events and has the PhysicsActor collision preset.
Behavior: I have two instances of the same actor class, one that is the player character and an immobile version of the same actor that is placed in the level. When I take the player’s box collision and ram it into the immobile capsule collision, neither of the hit events fire and so the box collision does not stop spinning, but when the center of the player box collision intersects with the immobile capsule collision, a physical reaction happens despite the events not firing. When I back the player character’s capsule collision into the immobile box collision both events fire and the physical reaction occurs upon impact, as it should. If I take the player box collision and ram it into the Shape_Sphere, a breakpoint in component hit event does not trigger but the event’s code clearly runs since the box collision stops spinning on collision. This could not be caused by other code since, when I remove the code from that event, the box collision does not stop spinning on impact with the Shape_Sphere. Furthermore, the box collision collides outside of its center like normal with the Shape_Sphere.
Solution Attempts: An obvious possible solution is that Simulation Generates Hits Events is not checked in the actor, but as I said earlier, it is checked for both the box collision and the capsule collision. I tried setting the collision so that it would only collide while attacking (NoCollision collision preset, set collision enabled on attack), but the result is the same. I looked over the details of the playable actor and the immobile actor during runtime to see if there were any differences in their capsule collisions. There was one, but changing that value was inconsequential. I don’t see any way to look at the box collisions during runtime since the details of the actor from the world list don’t show all of the actor’s children.
In conclusion, my actor’s collision objects are behaving differently between instances for no reason that I can discern. Additionally, a breakpoint is not triggering inside of an on component hit event even though it’s impossible for that code to not be running. Any help figuring out this problem would be much appreciated!
I’ve attached a screenshot of my on component hit blueprint.
Note that the comment around the event is incorrect, the box collision (BladeBox) of the actor that’s doing the hitting is being set to stop spinning.
Thank you and have a wonderful day!