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”
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.
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 )
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.
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.