No announcement yet.

Need help with spline based movement

  • Filter
  • Time
  • Show
Clear All
new posts

    Need help with spline based movement

    I am trying to make a game like resogun where the player is locked to a circular path shooting enemies. I looked around and apparently the only way to lock player movement to a circle is to use splines.
    I tried to follow this tutorial but am stuck on the first bit:

    He creates a variable with the type, Spline_C and then puts that into the target of his other variable, spline_c does not seem to exist in my unreal, I have tried all other variable types with spline in the name and they don't work. I just cant seem to get that spline1 target bit,

    If it is a simple solution don't judge me I have only been using unreal for a month

    Hi Leofixx,

    Here is a skeleton example project based on that tutorial that should help you get started. While not exactly like the game you want to make, it shows a working implementation of following a spline path.

    Note, you'll have to manually load the as there's no game mode. Use WASD to move the player. The camera automatically follows the spline.Everything else should make sense, if not chuck me a reply.
    Last edited by Yog-Shoggoth; 06-19-2015, 12:15 PM.


      Thank you very much, I looked at what you did and it helped alot. I've now got it working
      I do have another problem now, if you look at this gif you will see that my cube character is following the path as I would like. For the game i'm trying to make however I need the camera to constantly be at the side of the character, facing into the circle (Where all the cuboids are). do you think you could help me with that?


        Hi Leofixx,

        You need to modify your character blueprint to set the rotation of the player and the camera to match the spline tangent, see the screenshot below. You'll also need to set the spring arm on the character to -90ยบ on the Z axis and enable the Inherit Yaw option under the Camera Settings section.
        Click image for larger version

Name:	Spline_Camera_Correction.png
Views:	1
Size:	150.3 KB
ID:	1080142