Cannot place spline point on actor

Hello,

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.

Here’s how I place the two spline points:

And here is the result (the debug boxes show the missile and the target’s location):

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?

I should specify that the target actor is static.

Thank you

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:

How do you reference the target, is it valid? If it’s not, the point will still be added but at 0,0,0.

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.

Debug it. Draw some debug spheres, see where you’re actually placing it. Count points manually. Run this on Begin Play:

You’ll be able to see the spline run-time.

That node doesn’t seem to work, but detaching from the player controller and selecting the missile, this is what it looks like:

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.

Nevermind, there was some old code that I forgot about, that also grabbed a target on its own and changed the actor’s rotation.

Thank you (again) @Everynone for the help and sorry for the waste of time.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.