How to switch camera by pressing a key only if character is within an actors collision.

I currently have it set up using the “Set View Target with Blend” node. I can get the camera to switch from anywhere when I press a key or automatically if the character walk up to a specific actor with a collision. However I cannot figure out how to make it so that both the key needs to be pressed and the character needs to be inside an actors collision.

Hi @nrvdm.cryonaut

This is easier than you think if you apply the right logic.

The easiest method is to create a new boolean say call it “bInRange”

On BeginOverlap check its the correct actor and set the boolean as true

On EndOverlap check again that its the correct actor and set the boolean as false

In your key press logic just do a branch on bInRange if true run your code, if false do nothing or some other code

Hope this helps

1 Like