Trace hit results error of none accessed

Hello,

I followed this tutorial’s top comment on creating a ladder in the FPS template.

It is working great but there is one issue in the code, it throws a none accessed error on the line trace if I’m not in front of my ladder. I’m not sure what type of check I can place in there when it is not hitting any surface.

First person BP:

Error thrown when not looking at my dummy ladder:

114115-errorthrownhere.png

That was it, Thank you!

for anyone else out there here is the modified code I have, no error is shown and it runs smoothly.

Yes, the problem is that you trying to access the return actor without verifying first that it actually exists. What you need to do is have an extra branch that first checks if the line trace actually found something and then you do the check for the has tag and the is falling. If the line trace doesn’t find something, i.e. you looking at the sky then the hit result will contain null values and so you are trying to use those values even when they are null.

Something like this:

Hope this helps! :smiley:

Edit: I just noticed that the first condition in your AND actually is the return boolean from the line trace. I’m not actually sure if Blueprints behave exactly like written code in this matter, where if the first condition evaluates to false then it doesn’t check the other 2 conditions. If that’s the case then the problem should be something else. Please try what I did and tell me if that solves it, if not, I’ll try to do some tests.