Teleporting with hand controllers Crash!

When I change from camera to Right or LeftController I get this. The compilation in VS and Unreal is fine but after, when I press start unreal is crash.

FVector Start = LeftController->GetComponentLocation();

FVector End = Start + LeftController->GetForwardVector() * MaxTeleportDistance;

//FVector Start = Camera->GetComponentLocation();

//FVector End = Start + Camera->GetForwardVector() * MaxTeleportDistance;


I Think the problem is here, in the inicialitation but I don’t know why. Pointers are initialized in the class constructor but It tell me that they aren’t inicialitation when I’m checking with a if. I’ve trying several things but it not work. I need some help.
The controllers are visible and its inputs are working well if I don’t use its code, right.


I did a breakpoint and this is the result. UPrimitiveComponent is null. What can I do?

What can I do?

The problem isn’t that UPrimitiveComponent is null. UPrimitiveComponent is a type, not a variable.
The problem IS that your LeftController is null. You can see this at your breakpoint above the blue selected line.

I would set a breakpoint where LeftController is supposed to be initialised and see if that’s being called. Either it’s not being called, or somewhere the LeftController is being cleared.

Best of Luck,
Michael M.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms