I have a pawn that is moving along a spline via changing a variable (“Distance Along Spline”) each tick. The actor will start at x = 300, for example, and move perfectly, until it reaches x = 200. This same thing happens, where it will only move 100 over no matter which place, direction, or speed I give it. No other pawn has this problem with its spline. The variable itself is updating, so the problem seems to be with the “Set World Location and Rotation” node. Is there a secret setting that I accidentally toggled or something?
Here is my code to move the pawn:
The bottom branch coming into that final node is from a begin play event. It sets up the variables, etc, etc, and then runs the Set Location node one time. The tick event is then running the node for the rest of the animation.
It’s that TransformLocation node. I see you’re not using the rotation anyway, so why not just plug the vector from GetLocationatDistanceAlongSpline into the SetWorldLocation(andRotation )
I do actually need that node, in order to change the starting location for various instances of the object. I tried connecting the Get Location Distance straight into Set World Location anyways, and it still stopped after moving the same distance, just now starting at the origin.
What are you trying to achieve? The pawn starts at a random distance along the spline?
That TransformLocation node is for translating from local to world space.
There’s also some ‘strange wiring’ in this bit of BP. I mean, the SetActorLocation on the left, and the DistanceAlongSpline = 0 also attaching to the SetWorldLocationandRotaton, could these pins be triggered during the pawn’s travel?..
In case anyone finds this in the future, the issue was that the pawn was going to sleep. I changed it by going into the Static Mesh’s details and changing the sleep family to a custom one, and then setting the sleep threshold to 0.
I’m calling several instances of this pawn, with different variables, in order to create several objects. They all have different starting points throughout the map, saved as the Starting Location transform variable. Those nodes coming in from the left are the end of what happens at initialization. I set the color, size, starting location, etc, and then call SetWorldLocation one time there, and pick up setting the location with each event tick. I did actually figure out the issue though, it had to do with the pawn going to sleep when I didn’t want it to.