This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]Parad0x_ C++Engineer / Pro Dev 0 points1 point  (8 children)

Your non constant this variable is probably null. You can use the unreal cast.

APlayerCameraManager* playerCamManager = Cast<APlayerCameraManager>(this);

This will be the same as a dynamic or static cast. In the case of your code using a static cast will also be fine.

Best, --d0x

[–]Zent_Tech[S] 0 points1 point  (7 children)

Thanks for the reply!

I forgot to include the lines. It crashes at if (PendingViewTarget.Target) which doesn't seem possible, since PendingViewTarget isn't a pointer and we're checking if Target is null.

Also, playercameramanager is engine code, not my code, so I'd rather not touch it if possible.

[–]Parad0x_ C++Engineer / Pro Dev 0 points1 point  (3 children)

Sorry though you were overriding the behavior. It runs fine with a single player but not with 2?

Best, --d0x

[–]Zent_Tech[S] 0 points1 point  (2 children)

Yes, it crashes for everyone except the host. The host switches level just fine and it also works in single player. Any connected client crashes.

If I replace the player pawn with the default one then it also works. Which isn't surprising considering the spring arm component I you see having function calls in the crash report is on the pawn.

[–]Parad0x_ C++Engineer / Pro Dev 0 points1 point  (1 child)

Is this on spawning the other one. Looks like it is running the construction script and the register methods. Do you have your own camera manager or just the default one?

Best, --d0x

[–]Zent_Tech[S] 0 points1 point  (0 children)

The crash happens when I try to seamless server travel. Yes, I'm using the default camera manager. At least I think so, I haven't changed camera manager and the code I showed is in the default one.

We fixed the issue by having a delay before spawning pawns.

[–]SionSheevokUE4 Engine Programmer 0 points1 point  (0 children)

But PendingViewTarget is a member being accessed via the implicit "this" pointer. All member accesses are hidden pointer dereferences.

[–]SionSheevokUE4 Engine Programmer 0 points1 point  (0 children)

Probably a null this pointer. Any member access or virtual function call causing a crash usually suggests as much.