I want to make a pawn invisible when pressing a key.
I know there are other ways to achieve this goal. But what I would like to do is to avoid touching the SensingComponent, but to modify only the Pawn attributes. For instance modify its collision layer or whatever.
Is it possible to do so?
Looking into the implementation of SensingComponent I noticed that it checks with the pawn if there is some element in the middle that blocks a casted ray. If there is not, the pawn is visible and therefore can trigger the Seen event.
Therefore, to solve my issue, I created a capsule component that wraps the element that I want not to be noticed, and set its response to collision.
Capsule->SetCollisionResponseToChannel(ECC_Visibility, ECollisionResponse::ECR_B