# Switch spline to follow on player input in EndlessRunner game

**URL:** <https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [April 17, 2023, 6:59pm UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628 "2023-04-17T18:59:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhakatiri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rhakatiri](https://forums.unrealengine.com/u/Rhakatiri)\
**Post date:** [April 17, 2023, 6:59pm UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628/1 "2023-04-17T18:59:34Z")

</div>

I have 3 splines on my Tile that keeps getting generated as my player goes from one to another. and I have player follow middle. I want that on player input they can swap what spline they want to follow. For now if i try to swap it snaps back to middle one.

I got alot of help from this one [Endless runner. Spline paths - #63 by R3DMyst89](https://forums.unrealengine.com/t/endless-runner-spline-paths/461999/63) But still I cant figure it out completely.

I set the last spline point here .

 ![Set Spline last point](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/0/200dd0737362629da7af57e107a87b7bc2a4876b.png)

If player pverlaps actor this var is set.

 ![Should follow.](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/d/0bde641fe8aa47f200f0a46c4c9ada68f4412b35.png)

code to follow spline .

 ![Followspline](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/c/94c06642c22a7f622879b5beef57f02ab58994bb.png)  
 ![Capture](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/1/20113ebd564244f94eabc615789fecdc8979f47e.png)

It gets the variable that is currently true from splinechooser that.

 ![Splinechooser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/e/aae055b830b725f4dd8cbadb40bf65e181ea3c4b.png)

This is in my SplineChooser . It gets currentLane from my player.

 ![Setspline](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/f/cbf102e9f9b9dc3376c1228ccb57da8dcae6e9b5.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2023, 9:18am UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628/2 "2023-04-18T09:18:31Z")

</div>

I assume what’s happening, is the player is choosing to use another lane, but that decision is getting reset when they change tiles?

---

<div class="post-metadata">

**Author:** ![Rhakatiri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rhakatiri](https://forums.unrealengine.com/u/Rhakatiri)\
**Post date:** [April 18, 2023, 10:52am UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628/3 "2023-04-18T10:52:32Z")

</div>

I think so . It worked really clumsily and broken when I threw swap lane function into tiles tick event.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2023, 11:05am UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628/4 "2023-04-18T11:05:21Z")

</div>

Right, that would not be the place. But once you’ve chosen the left lane ( for instance ), the variable should stay the same, even when swapping tiles…

---

<div class="post-metadata">

**Author:** ![Rhakatiri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rhakatiri](https://forums.unrealengine.com/u/Rhakatiri)\
**Post date:** [April 18, 2023, 6:32pm UTC](https://forums.unrealengine.com/t/switch-spline-to-follow-on-player-input-in-endlessrunner-game/1092628/5 "2023-04-18T18:32:48Z")

</div>

Atm when I gave it input to change lane it moved to new lane couple of tiles later and it stayed there. but after couple of turns (90 degree corner) later it just goes off the spline cause of weird rotation, Maybe I should trash the splines and figure out how to just center the mesh to middle lane after the corners
