Hey everyone. I have a problem which has left me pulling my hair out.
I am using UE5.5 and I’ve made a Target Lock System.
I have a continuous check if LoS has been broken for a specific amount of time. If so, then the Target Lock should unlock. So far so good and it is working.
HOWEVER:
When I place my Enemy Actor in the world through editor, the Target Lock works without any issues. But when I spawn my Enemy Actor via code, the traces are acting up. My LoS Checker seems to react to the Enemy, even if it shouldn’t. I repeat: When I place the enemy into the world VIA EDITOR, the LoS Trace does NOT react on the enemy (as it should). But when I use spawn actor from class, then the Trace reacts to the enemy although it shouldn’t.
In earlier versions of unreal engine, you were able to fix this by using RecreatePhysicsState. However, this function does not exist in 5.5 any longer. And now I am pretty much done for. If I can’t fix this issue, my entire Combat Mechanics wouldn’t make any sense to have anymore. Hours on hours of research but I couldn’t find any solutions. Even the AI solutions don’t even work or in best cases the AI calls out apparent functions which don’t seem to exist either.
Hope anyone knows how to fix this. I appreciate any help possible. Running a bit low on time xD
What I tried already:
- Checking collision settings in the Actor’s details Panel
- Set Collision Response To Channel after spawned object on both mesh and capsule collision
- Set Collision Enabled
- Checked the Trace Responses for the spawned actors (they are all set to ignore which is what we want, yet despite it being set to ignore, it does anything but ignoring the actor .-.)