I’m trying to learn how to use splines and this is very weird to me. I have this missile actor that detects a target via line trace. And I want to make a spline that goes from the missile to the target. But for some reason the last spline point is completely offset.
My expectation would be that the spline goes from one actor to the other.
I’ve tried changing the coordinate space to Local, I’ve removed all the tangent calculations, nothing has changed. I have also tried to calculate the last point’s location by subtracting the target location from the missile’s location (and vice versa), that didn’t change either.
I really don’t understand why that doesn’t work since it seems to me that my setup is pretty standard, is there something I don’t know about spline points that would prevent me from doing this?
A spline component starts off with 2 spline points already - 0 & 1. If you add 2 more, as in your pic, there will be 4 in total. Could this be the issue?
In case you do Clear spline points before adding new ones, double check this part:
I do clear the spline points before adding new ones.
I checked the validity of the Target Actor and it is valid. I also tried with using its capsule collision as target instead of the entire actor and go the same result.
I get the target actor from a ray trace and store the hit actor in that variable.
Just to add more precisions, the spline mesh shown on my screenshot is accurate. When I ask the missile to move along the spline, its path matches the spline mesh exactly.
I can also confirm that the spline only has 2 points.
I’ve tried storing the raytrace’s hit location and using that instead of the actor/component’s location, and the result is the same, only… the offset is on the other side.
Correction: the ShowSplines node seems to work, it’s just that the spline is hidden by the spline mesh
Looks like this has actually nothing to do with feeding a raytraced location into the spline. I have the offset even when using the code that doesn’t raytrace. I’ll investigate this more carefully.