Curious Conundrums in Collision and Line Trace Detection

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?

I’ve figured out this strange issue on my own. Since I’m working on a 2D game, when a brick collides, I set its Y-axis position to 0. However, other collision rays originate from the center of the brick, which is much higher on the Y-axis than 0. As a result, there’s a gap between the bricks on the Y-axis, but it’s not visible under an orthographic camera. It’s not that the rays hit with no response; they simply aren’t hitting at all.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.