Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Actor wont travel on spline

What am i doing wrong?

When i get into the car and i click spline 1 the car teleports to the spline but then does not move.......According to the blueprint it should be moving............wth is going on

alt text

Product Version: UE 4.19
spline-track.png (274.7 kB)
more ▼

asked Jun 30 '18 at 02:03 AM in Blueprint Scripting

avatar image

21 3 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

From what I can see, I suspect you are simply not setting the correct distance. Spline distance is based on the actual length of the spline, not on a normalized value. In your timeline I see that you are animating to a max distance of about 5 over a period of 15 seconds, but in Unreal units, that is almost nothing. I suspect your car IS moving, but it is moving so slow it may just as well be standing still.

I think it would be best to animate your timeline from 0-1, and multiply that track output with the spline length. That way the timeline can be used for all splines (which is important, since you have potentially multiple splines whose length can (vastly) differ).

In case you need the car to move at a constant speed (considering you used a speed variable), it is better to abandon the timeline entirely (since timelines are fixed in length, and with variable spline length and a constant car speed you would need timelines with variable length to move your car). It would be better in that instance to delete the timeline bit and simply call that custom event from the Tick.

more ▼

answered Jun 30 '18 at 02:58 AM

avatar image

815 31 28 105

avatar image Snoxx Jun 30 '18 at 06:06 AM

What about if i wanted the car to speed up half way or at specific points along the spline? Sorry if the questions i ask are not so easy to answer. I am very new to splines xD and since making this thread I have some how buggered up the possessing of the car -,- The struggles are real.

avatar image cridia Jun 30 '18 at 10:02 PM

If you want to speed up the car halfway along the spline, get the spline length, divide it by 2 and do a check whether the current traveled distance along the spline is equal to or bigger than the half spline length. When that is true simply speed up the car. If you want to do specific points, it depends on whether you want those points to be fixed at a specific distance or based on a percentage (like after 25% of the spline).

For specific points, simply setup an array of variables or something and everytime you update the location of your car, compare your current distance to the variables you set. If something returns true, do something. If you want percentages, simply do the above thing with getting the spline length and dividing it by some value.

avatar image Snoxx Jun 30 '18 at 02:06 PM

I got this from a youtube video and his works.....mine doesnt........There is nothing different to his code to mine. yet mine wont work.

alt text

avatar image cridia Jun 30 '18 at 10:09 PM

Going by this screenshot, you would have to connect the play from start or play from the timeline to some event. Right now the timeline simply isn't being called.

It's a bit superfluous to add the world delta seconds to the game time first though. World delta seconds is the time since the last tick, so that value is like 1/60th of a second (or worse if your framerate is higher). Since that is near 0, just using the game time should be more than enough.

Also, something that may happen in this instance is that your car skips ahead of the curve. This is because gametime starts ticking the moment the game start. If this blueprint is, say, started 5 seconds after you start the game, the gametime will essentially already be 5 seconds. If you want to prevent this, make a "start time" variable that you set to the current game time before you start the timeline. Then, when updating the timeline use the current game time minus the start time variable you created so you have a nice count starting from 0.

avatar image Snoxx Jul 01 '18 at 02:17 AM

Ok, first of all a couple of key points. That blueprint is the actual object I wanted to move(car) and secondly, that is EXACTLY the same blueprint layout the guy had it in the video and his car moves and mine didnt.

BUT I have fixed the issue now and I got it to work. I also managed to make it so each spline track has an index and I can choose which spline track to follow depending on what index i set in the menu widget buttons

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question