Line trace collision not working when out of camera

Hi everyone, I create a friend-AI character from an enemy-AI character, so they can melee attack each other(line trace for collision handle), everything is fine when the camera(from the controlled player) is toward them, but when the camera is backward(can’t see the two characters), the two characters still melee attack each other, but the attack collisions don’t happen, until the camera is toward them again. Is line trace invalid if it’s out of camera? Can anyone give me a hint? Thanks a lot.

I guess it is the forward vector from the camera that needs to be towards the other character.

In fact the line trace is from friend-AI character to enemy-AI character (or from enemy to friend), the controlled player is just an observer, so the line trace isn’t from the camera. But when the camera is toward them, the line trace works fine, when the camera turns back, the line trace doesn’t work, very odd bug :frowning:

I got the same problem with my AI, when I turn the camera the linetrace stop being cast, still trying to figure out a workaround. Tried running the linetrace from a function into the game instance and then the game mode but then the lines never appear even if the camera is looking

Have you found a solution for this problem?
I’m facing the same problem.

Is the trace logic triggered by something animation based?
If so, skeletal mesh components have an optimization setting called “Visibility Based Anim Tick Option” where you can set it to not update when it’s not visible, so make sure it’s not set to “only tick when rendered”