EQS camera trace from third person camera

Working on a hiding behavior with EQS and Behavior Tree.

I’ve got distance and visibility working based on a context from the player character. Tried changing the context to query, my player, etc. Tried Trace to Item and bool match.

I can’t seem to trace from the third person camera to filter results.

1 Like

Sounds like you just need to implement a kind of ‘EnvQueryContext_ThirdPersonCamera’ and use it for visibility test. You can easily implement such a context it both in C++ and Blueprints.

Cheers,

–mieszko

I tried a couple variations with no success. I tried reaching into the Character and grabbing the component, but that was incompatible with actor type that the function in the context wants. I ended up making a blueprint that has a null that reaches into the camera component and matches its position on tick. Then I used that blueprint and populated the context with ‘getAllActorsofClass’ for a standard visibility trace. Pretty sketchy, and doesn’t work that well.

I think I’m missing something obvious in setting the context.

Make a blueprint derived from EnvQueryContext_BlueprintBase, implement ProvideSingleLocation and return camera’s location. Have you tried that? Maybe I am missing something :smiley:

1 Like

That was the first thing I tried, but it behaved as if it didn’t update the position on tick. I’ll try again.

Not sure what you mean by “on tick”. Context is asked to supply location/actor when it’s needed, and is never ticked (at least not as part of EQS processing).