Help me with this "Accessed None" error in animation blueprint

The error is caused by object reference to the side scroller character. I have read and looked over many threads but can’t seem to stop this error. Most seem to say the reason for the error is that a variable is not set properly. But I set it right after the cast? Some suggested an is valid node to alleviate the error (which has worked for me in the past) but no luck with that.

I need the obj reference so that I can get access in the ABP to that characters variables and capsule component.

What am I missing here?

Thanks for any and all help.

1 Like

Well, first it doesn´t make much sense to have this loop going from the “is valid” back to the cast, because if it failed at this point it won´t get any better. Second, it is not a good idea to perform a cast on the update event, because this event is fired every tick(?), at least very often and a cast costs a bit in terms of performance. It would be better to setup the cast in the event blueprint initialize animation event. “Get owning actor” into the cast to “sidescrollercharacter” and then you promote this to a variable. In your update event you can then use this variable to access things you need on every tick change. To be one the safe side you can also use a “validated get” to check if the refercence to the character is valid. Justright click on a variable and change it to a validated get. Hope that helps.

1 Like

Thank you.

You are using a delay node and assume the var is still valid after the delay instead of using the var directly as you should. Don’t create that strange loop.

1 Like

I had the delay there because a few threads suggested using a delay sometimes stops the “accessed none” error.