Download

If object reference is empty

Hi!
Fast forward: I have a car and it has an object reference to a spline path actor. It gets a vector of the path’s first point.
The problem is: the object reference can be empty. Right now, the car always tries to get the vector, so in case there’s no referenced path, errors begin to appear (obviously).

I struggle to find the condition to test its emptiness. Somewhere I found “Is valid” but it doesn’t work for me (maybe I used it wrongly?). I was looking for something like “The path equals nothing” or “The path doesn’t equal its class” but nothing worked.

Please, any suggestion what should I look for?

Hi man,
give us a screenshot,
otherwise you can test the lengt of the path, if is 0,

Sorry, I said it too simplified, it’s an actor containing a spline.

So, the screenshot. The orange highlights the existing variable, how it’s assigned in the car and what exact kind of variable it is. (an actor with DefaultSceneRoot, Spline and several spheres for debugging)
The red highlights what I need to work - to having the reference empty (None) without getting errors about the missing reference.
The blueprint shows what I need: “If the Path variable is not empty (None), set the location, else do nothing”

I’ve never been working with them…how about the Soft Object Reference?

IS VALID node

Thank you!