access character objects in level script

Hi, guys! I am trying to switch the third Person camera to a camera I placed in the scene. This switch is triggered via trigger volume. It works by using the set view blend function, but Ehen I want to switch back to normal third Person view, the camera is inserted in the character.

Is there a way oft accessing the “followcam” reference (in mycharacter) in the level script?

Then I could plug that cam Ingo the set view target blend.

Thanks,
Olivier

you can use getAllActorsByClass function. but it might be better if you wrap a camera in a blueprint so you can save a reference in blueprint that you can have access to later on.
and thanks to you now I know another interesting function. :slight_smile:

Hi, PenguinTD,

thanks for you input and I´m glad that I could show you another interesting BP-node :-). I´m a little stuck with getting the data out of the class… just starting with BP and I have to get used to it :slight_smile:

How do I get the “FollowCam” out of the Class so that I can connect it up the new view target?

if you are pretty sure there will only be one of those MixamoCharacter, you can use “get” node which provides link from out actors array and just specify index 0.
Make sure you check the result with “isValid”, if true then pass that actor to your NewVeiwTarget, the function should search for a camera component to use from the actor.

I haven’t had a chance to experiment with this function yet, but I assume that how it should work.
(in official doc, this parameter is defined class AActor * NewViewTarget, so the camera inside your character bp should be picked up by this function.)

Awesome, it works :slight_smile: Thank you very much! :slight_smile: