Unreal Project crash when switch Camera

Hi, I am desperate. I have a project that works fine in the editor but crashes when packaged. I narrowed it down to the reason was because of the switch camera function. In the game I have set up buttons if pressed the switch to the fixed assigned camera like this:
Here is the setup in the level blueprint


And here is in the game mode:

Did I do it wrong? How can I fix it? Please help me

Are you your switch function doesn’t get called before setting the camera reference?
Make sure tu add a IsValid before the setViewTargetWithBlend for both your player and camera, just to be extra sure they’re there when the node is called.

Btw if you package in development you should have some logs somewhere.
Check this:

Additionally, you should get the editor symbol, this will give you a readable crash report that you can screen here when you crash.
To do so go to the epic launcher, on your engine version click the arrow, go to Options, enable Editor Symbol (the one at the bottom here)

They take some space, but you should find some room until your issue is resolved.

Hi, I try to remove everything in the level blueprint and start one by one using Standalone. So I crashed when I tried to play in a Standalone with only the view target blend… How is the view target blend such a problem?

Hm, what’s the value of “camera R” when it’s passed in “Switch R” function? Is it “null” when you pass it to the Set View Target? You’ve assigned it to itself after Set View Target, which doesn’t make much sense to me.

Keep an eye out for the order which your functions and actors is called/ran and check to see if nodes are valid before passing them at point of failure and print debug messages, see if that helps you to further nail down the issue.

You’re right, I changed the function to call the “Camera_R” directly in the Widget.


But the crash still happens. It crashes even if I just plug in the view target blend in the Level Blueprint.

I checked the log crash but nothing indicates a reason!

Okie, problem solved, turns out I used the wrong camera type (Cine Camera). It is supposed to be a Camera Actor only apparently.
Thank you for the help anyway!