Download

Accessed none

yo
I’ve got an accessed none error, can someone help me ?
Here is the whole BP + Sorry for the vid, english isn’t my ******_language
http://prntscr.com/50mqxd
http://prntscr.com/50mr23

How is this event being called? Are both screenshots from a separate blueprint?

It looks like the problem is simply that many many traces are being run at the same time. About 50 or so actually hit the actor because they execute so fast. Only the first one destroys the actor, the rest throw errors (trying to destroy something that no longer exists). That’s my guess.

Is that error happening before he’s even destroyed?

If not, he could try putting in a branch and attach an “is valid” with the actor there to give it one last check before destroying it, though there’s still the chance that in the time between checking if it was valid and trying to destroy it, it gets destroyed.

I think the solution might lie more in a “run once” node to ensure it is only destroyed once, then possibly add a delay of one second after it is destroyed and loop the execution back to the “reset” pin. It’s kind of a hack-y solution but I think it would work.

I asked because I often get “Accessed None” for the completely wrong node. Like I’ll remove the node where it says the error is, and then the error just moves to another node.

In that case, the error is being caused before those nodes, or something isn’t being checked as valid before doing operations on it.

Go through and make sure you’ll know an object is valid before accessing its members.

I do think some work could be done to improve the accessed none messages and more correctly highlight what nodes are responsible.

Or just have the “Delete Actor” function handle it. Add a bool return pin to show if it was deleted or not. No need to log an error, simply handle it and give the output if the user decides they want it.

I’ve had these happen in different graphs. I’ll have to document it next time just to make sure I’m not going crazy. I feel like I get loads of problems in BP. Another problem I get is where I set a breakpoint, hit the breakpoint, but can’t read any of the data leading to that breakpoint. I just get variable descriptions.

I have this problem specifically with “Return Node”; if the error happens at some point during a cast, interface message, or function, or macro, or whatever, the system seems to grab the first “Return Node” it finds and report THAT as the problem, rather than whatever node is actually DOING the returning.

I assume that’s just a quirk of UE4, something to do with the generic-ness of return nodes in general.

So i need to add what ?

Use the IsValid macro before attempting to destroy the returned actor and see if that works. Though I don’t see how a Hit would return a None actor. So also see what happens if you don’t destroy the actor (sans the IsValid).

Here’s what I’d do

Firstly, We need to determine when the error is being thrown. I’m assuming you have these traces being called from an Event Tick. I would replace that with a keyboard press, such as “Enter”. Then, I would walk just the way you did in the video, pressing enter every second. Make sure that everything performs as it should and when you close the game, there are no errors.

Edit: Then do what Cobryis said with the IsValid node.

If there are no errors from the previous step, that means my theory is likely true and you are firing off a lot of traces before the actor can get deleted. Ex:
T=0 - Ran Trace 1
T=1 - Ran Trace 2
T=2 - Ran Trace 3
T=3 - Ran Trace 4. Trace 1 hit nothing.
T=4 - Ran Trace 5. Trace 2 hit nothing.
T=5 - Ran Trace 6. Trace 3 hit nothing. Trace 1 execution ends.
T=6 - Ran Trace 7. Trace 4 hit nothing. Trace 2 execution ends.
T=7 - Ran Trace 8. Trace 5 hit something. Trace 3 execution ends.
T=8 - Ran Trace 9. Trace 6 hit something. Trace 4 execution ends.
T=9 - Ran Trace 10. Trace 7 hit something. Trace 5 deletes object.
T=10 - Ran Trace 11. Trace 8 hit nothing. Trace 6 deletes object. ERROR - No Object.
T=11 - Ran Trace 12. Trace 9 hit nothing. Trace 7 deletes object. ERROR - No Object.
T=12 - Ran Trace 13. Trace 10 hit nothing. Trace 8 execution ends.
T=13 - Ran Trace 14. Trace 11 hit nothing. Trace 9 execution ends.
Etc, etc.

So basically, in this example, after Trace 1 has executed, Trace 2 and 3 are fired off before Trace 1 can even be PROCESSED. And then another two ticks before Trace 1’s execution even ends.

This means when Trace 5 hits your object, Trace 6 and 7 ALSO hit that object before Trace 5 even has a chance to delete the object. Then Trace 6 and 7 come around and try to delete the same object but there’s nothing there anymore.

In this example, you’d only see two errors. In your example, there’s like 50 of them… so instead of only having 2 traces try to delete an object that isn’t there, you have 50 - it’s running at a much faster pace than my example.

One solution, as I stated above, would be to add a “Do Once” node to prevent the actor from being destroyed repeatedly. Then add a 1 second delay and wire it to the “Reset” node.

I’m at work and only have MSPaint available, but here’s what I could put together:

79f32f01a89d143170491ecf0585ef5b6af9d149.png

That will change the flow to this:


T=7 - Ran Trace 8. Trace 5 hit something. Trace 3 execution ends.
T=8 - Ran Trace 9. Trace 6 hit something. Trace 4 execution ends.
T=9 - Ran Trace 10. Trace 7 hit something. Trace 5 deletes object. Starts waiting for 1 second.
T=10 - Ran Trace 11. Trace 8 hit nothing. Trace 6 Hits DoOnce node and ends.
T=11 - Ran Trace 12. Trace 9 hit nothing. Trace 7 Hits DoOnce node and ends.
T=12 - Ran Trace 13. Trace 10 hit nothing. Trace 8 execution ends.
T=13 - Ran Trace 14. Trace 11 hit nothing. Trace 9 execution ends.
(One second later)
T=N - Ran Trace N+1. Trace N-2 hit something. Trace N-4 execution ends. Trace 5 Delay complete, resetting DoOnce node.

This will cause a problem if you need to destroy more than 1 actor per second. You could lower the delay to .5 and probably be fine. Maybe even lower. I don’t know how many events per second are being fired from that Event Tick.

I think i know what’s happenning for the second things (the player drop and world dissapear) it’s because my trace by channel goes weird and fires on the tile under it, how to properly trace a line at
X = player.PosX + 3*floor.sizeX
Y/Z 0

Bump please

Hi MyPix,

Please do not bump threads when they have not gone unanswered for more than 4 days. This clutters the forums and makes it difficult to parse through and assist users. Thank you.

I can’t see your start position of your trace, but I want to make sure you’re aware the ray traces from start to end. If you have your start and end backwards, you might be getting an unexpected object. You also aren’t ignoring self btw, though I’m not sure what effect that has in your context.

Err, i’m still trying can’t get that to work

Edit : Got it to work, i was using Floor_c which was destroyed shortly after beginning, causing accessed none