After protecting the pointers should the code still be functional?

Hey all,

I just went through this lesson and added in the pattern that Ben suggested that we add in to protect against errors from pointers (ex: if (!PressurePlate) { return; } ) and found that for every component that I did this, my code stopped working… It doesn’t crash, it just acts as if it does not exist… Should the code still be working?

Any suggestions?

Thanks for your help!

So I figured out the solution, but I don’t understand it… I had tried to protect against all of the pointers, *Owner included… When I protected against *PressurePlate, *PawnInputComponent, and *PhysicsHandle, everything works fine. However, when I add protectors against *Owner to the code before owner statements ( if (!Owner) { return; } ), then the code becomes entirely unresponsive. Does anyone know why this is?

Thanks again!

Privacy & Terms