[Solved] How change camera when entering a box collision by BP?

Hello,

Im trying to change the camera when the player enter a trigger (box collision), but no success.
I just want to change the camera when the player overlap the trigger, I know how to do it inside the Level BP with the “Set View Target with Blend”, but I need to do it inside a BP (like the one on the image below)…

Anyone know how its possible?

In player controller you can call function SetViewTarget.

Here is an example how it works for me:

Thanks, but as I said before, I know how to use the Set View Target with Blend inside the Character or Level BP, but if I have more than 10+ cameras/trigger this is not the best option, so I as wondering how make a BP with trigger and camera, so when u go inside this BP trigger he active the camera in this BP

Okay, I think I got it :slight_smile:
Like this

I know how to do it inside the Level BP with the “Set View Target with Blend”, but I need to do it inside a BP (like the one on the image below)…

So I showed you how to do it in BP.

so when u go inside this BP trigger he
active the camera in this BP

What do you mean activate camera? If you want to see through this camera, you must use SetViewTarget in PlayerController. You see game through camera created by PlayerCameraManager. This manager referenced by PlayerController, and this is only one camera you can see through. So, when you use SetViewTarget, it takes camera inside your BP, and passes it as target camera to PlayerCameraManager.

Thanks @redbox :slight_smile: now its working :slight_smile:

Btw, do you know how to fix the problem with the begin overlap, when the character are already inside the trigger?

Eg: when you hit the play button, and the character is inside the trigger, but the trigger dont “work”… so u need to go out and in

There is function called getOverlappingActors.

You can use it in PlayerCharacter to get this CameraBPs class, or in CameraBPs to get PlayerCharacter class objects.

Use it on some event. Not in Tick, because its expensive. Maybe OnBeginPlay or after some delay OnBeginPlay.

If you have several cameras and are building something like a car, how do you kill all existing cameras as you enter the car, then use only the Car’s Cameras?