So i have this playable character the I controll, but i want the camera to follow a npc instead of the playable caracter, how can i do that?
Basiclly like a sports court side camera that follows the enemy player who has the ball for example
So i have this playable character the I controll, but i want the camera to follow a npc instead of the playable caracter, how can i do that?
Basiclly like a sports court side camera that follows the enemy player who has the ball for example
Each PlayerController has a ViewTarget. The ViewTarget is (confusingly) not the thing being viewed, but the thing that contains the camera being used.
So, you can do one of four things:
The call to make some object-containing-a-camera be the camera-for-a-player-controller is SetViewTargetWithBlend. You can set the blend time to 0 to make a hard cut, or provide a time when switching to “zoom” the camera between different perspectives. Although, if you switch perspectives, you probably want a specific animation for this, like pulling out/up, then moving to the next place, then zooming in/down, and you’d need more careful control to achieve that than you get by simply setting a blend time.
I cant find that ViewTarget anywhere, can you send me a screen shot pls?
Im gonna try be more specific:
I have this character that is a NPC:
And the i have this camera that I want it to be always on this side of the square (arena) like a typical camera in a football or basketball game:
What i want is to this camera to follow that NPC character without rotation, and i want this camera to be the main and starting camera.
Hope I was clear. If you could help i would be really greatfull
For the NPC you’re talking about, set up a camera component on a spring arm in that NPC Pawn, similar to how it’s done in the 3rd person player.
Mark the rotation as being in world space, not object space. Set it to whatever rotation you want.
When your playercontroller begins playing, call SetViewTargetWithBlend on the given NPC.
“call SetViewTargetWithBlend on the given NPC” this is given by the get player controller node? if yes how do i define/check the NPC index?
i also dont understand how do you get that camera reference since you tell me to put a camera as a component of the npc pawn
Nevermind i figured out. Thank you for the help