Construction Script error when launching homing missile

Hi everyone
I am getting a Construct Script error when for no reason when launching a homing missile at a target. I tried everything and I can’t figure out why I am getting this error. The error seems to be pointing to a variable and Current Target for some odd reason and I’m confused.

“Error Accessed None 'CurrentTarget ’ from node Construction Script in blueprint HomingMissile”


Show the construction script code, that’s where the error appears to be.

You can use the Is Valid? node to only do something if a reference is valid. So, check CurrentTarget with IsValid? and only go on in flow if it is.

There really isn’t anything there do I have to put something there?

The error is weird then. No, you don’t need anything in the construction script. In the second picture, before you get the location of the current target, check it with the IsValid? node. Only continue on and get it’s location if it is. Because this is everytick, it’s possible this is being called before the current target has been initialized.

Also, is there a reason why the tick time is not being handed into the Interp Node?

Ok Kind of confused about the IsValid node and it’s placement can you clarify where I’m suppose to connect it and which one am I suppose to use.

Use the flow control one, the one with the ?. You are literally testing to see if Current Target is Valid. Wire your execution flow into it, only get actor location from current target if it is Valid. Pull the wire down form the event tick, into it on the left. Then on the right from the Is Valid pin, wire it to the Set Location.

Also, if you don’t have a good reason to, use the time that comes in on the Tick event to wire it into your RInterpTo node, also it looks like that speed is set to 0 so you want to give it a time. ( I can’t tell,too blurry )

Ok I linked the IsValid in and the missile isn’t moving torts the target

Is it still crashing?

The game doesn’t crash anymore but the missile doesn’t do what it was intended to do it just stays in one place.

Have you placed a breakpoint to see if CurrentTarget is ever valid, and set location is being set? Also, have you changed your RInterpTo to take in the Delta Seconds instead of the WorldDelta like you are? As well, You should try a shorter Interp time probably, like 1 second or less.

Also, that isn’t normally how projectiles are steered. Usually you apply velocity. You might have collision problems after you eventually do get it to move, the way you are doing it.

I was trying to do this tutorial

Did you set a breakpoint and see if CurrentTarget is ever set to a value?

Select the Set Location and ROtation node, press F9 to set a breakpoint and then run. If it breaks on it you can inspect the values. If it doesn’t break on it you know your problem is where the Current Value is supposed to be set.