[BUG] When breaking a hit event and dragging of the actor

To reproduce:

  1. Do a simple line trace from camera to 1000 in front of the camera.
  2. Break hit event.
  3. Drag of “Hit Actor” and “get actor tags”.
  4. If no actor with tags was hit or no actor at all it returns errors.

Instead it should just return false if the “Hit Actor” is NULL.

Im not sure what you mean? You have to check if theres a hit so branch Return value, if true then grab your actor and check for tags. works fine that way for me.

You cant check actors or tags unless you resolve if it hit or not.

I reproduced what you said and if i didnt check “return vaue” on the trace i got errors, because im trying to access a “None” actor. add in the check for “return value” i get no errors.

Cannot reproduce your error unless i perform the trace check incorrectly by not checking for a hit.

If i followed you wrong i apologise and please paste the blueprint you have used for me to check my end.

I mean this:

When the line trace doesn’t hit anything, it gives this error:

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_BreakHitResult_HitActor_3”. Node: Set CrosshairLocation Graph: EventGraph Function: Execute Ubergraph Player Blueprint: Player

When I do this, it does not give an error:

I wanted to use the first blueprint because it seems more optimized.

Both will give an error, the only reason the 2nd one doesnt is possibly because its none blocking and you have checked for that.

You MUST check the return value before accessing the break hit as it will error if it didnt hit. You cannot access an actor or object that isnt there to access as no hit took place.

Attach a branch node to return value on the linetracebychannel. Only try to access the hit actor if this is true, it will work on the 1st blueprint and the second

Look at my image above where i come off the linetrace to a branch node and see how ot os connected

The second one does not give an error for me.

Because you are not gettong a blocking hit snd you are branching from it. Thats the reason
. The first one is fine if you check that there has been a hit, its not a bug is all i am saying. You are welcome to take that how you like of course. Happy coding