I’m working on a project in Unreal Engine 5 and have implemented camera transition functionality. Although the camera transition appears to be successful in the logs, it does not actually occur in the game. Here is the code and setup I am using:
There are a few ways to do this. What we do is make “controllable camera character” with a small collision sphere and flying. Then just Possess() the controllable camera character with your player controller. That way you can possess, move, turn, etc. the controlled camera just like any other character.
Running further with my assumption, I’m a bit confused about PlayerController->SetViewTarget(NewCamera); as this will just call back ACameraManager::SetViewTarget() which is not inherently wrong but… just curious.
Or maybe my assumption was wrong?
If that is the case you might check your actual APlayerCameraManager and see if it is valid. (because APlayerController::SetViewTarget() will fail silently if there is no valid camera manager)
No… unfortunately i made my CameraManager from just Actor . Well as for the PlayerController->SetViewTarget(NewCamera); SetViewTarget() function would probably be an PlayerController’s Function in this case… because SetViewTarget() is not particularly defined at CameraManager class. but could this be problem?
According to few of my Logs, CameraManager seems to be online
LogTemp: Warning: CameraManager found
LogWorldPartition: New Streaming Source: CameraPlayerController_0 -> Position: X=1040.008 Y=1211.294 Z=90.000
LogTemp: Warning: Found 2 cameras
PIE: Server logged in
PIE: Play in editor total start time 0.167 seconds.
LogTemp: Warning: Switching to camera index: 1
LogTemp: Warning: Current Camera: BP_FirstPersonCharacter_C_0
LogTemp: Warning: New Camera: BP_Cam1_C_UAID_D843AE24536D4B1C02_1293429303
LogTemp: Warning: Successfully switched to camera: BP_Cam1_C_UAID_D843AE24536D4B1C02_1293429303
LogTemp: Warning: Switched Camera
One thing not mentioned is that I am currently using the method to Scene Capture Component 2D (under each Camera Actors) and setting the Texture Target To RT_CameraFeed (Render Target). And I made an HUD and imported RT_CameraFeed as an image brush.
Could this method be related to my problem on camera changing?
This is why I asked if your APlayerCameraManager is set. Then again, if you are not deriving from it the default player camera manager should be provided for you and working. (check it anyway just in case)
I doubt that unless you are checking if the camera change works through the UI and the render target. Still, try to isolate the problem by disabling the the part that looks suspicious to you. You know your code best so you should follow your intuition.