Hi, guys. I’ve created a subclass of Pawn, with its main body being a static mesh. Beneath it, there are several boxes attached for collision detection, all of which are also static meshes. The collision relationships among these static meshes (excluding the main body, as it does not participate in collision detection) are as follows:
Then, within this subclass, I added a custom component where I implemented the following logic. In the Tick Event, a downward Z-axis ray is cast every frame for detection, using the Line Trace For Objects node. The array of Object Types for detection response is configured as follows, including World Static, World Dynamic, and Pawn (the latter is included because of the main body static mesh mentioned earlier, which has a collision relationship of Pawn). Then, I instantiated several objects using this class, expecting their rays to turn green upon hitting each other (indicating collision detection). However, according to the results of the raycasting, all the lines remain red, indicating no hits, which has left me puzzled.
However, when I directly drag a static mesh into the world scene and set its Collision Object Type to World Static, it can be detected, and the trace line turns green upon collision. Then, when I change it to World Dynamic, it still turns green.This indicates that the node is functioning properly. But objects generated by my class cannot detect each other. Could anyone provide insights into why this might be happening?