When Trying to Destroy Actor: Accessed None trying to read CallFunc_BreakHitResult

For example specifically, actor A has a light and a cube component. How to specify that only when the cube component is hit should A actor be destroyed altogether with the light, but not when the light is hit? I don`t know why the error message “Blueprint Runtime Error: ‘Accessed None trying to read CallFunc_BreakHitResult’…” But now I only assume it was something with the point light.

Screenshots of the setup would be helpful.

“Accessed None” is a very common error when your logic doesn’t account for the object not existing at that point in time. Whichever object you use to call “BreakHitResult” on, is either not created or pending kill at that point in time.

Make sure that prior to calling a function on an object you’re unsure of it being available, you place that object in an “IsValid” macro. Only when it returns true should you continue with your logic.

1 Like

But uhmm…Im pretty sure that the object exists in the level all the time. Only that clicking on it fails to destroy it. Now Ive changed the program to this: only when the Return Value of the LineTraceByChannel function is true would the right clicked object be destroyed. But I watched the value only to find that the Return Value won`t be true even if I right click on it.

Thank you for your time. Somehow the picture upoloading progress won`t proceed.

It finally uploaded. No matter how I click on the cube component the values just wouldn`t change

And before I set it up like this, I used to use a LineTraceByChannel function and it was returning the Accessed None message mentioned above.

Somehow theres an error in clicking objects, and I cant find what the issue is.

Now the problem is solved, thanks everybody.

Turns out that I need to first Enable Click Events…