Home Unreal Engine

How can I make the sidescroller camera not jump with me?

I just started messing around with UE about a week ago and I've been importing my models and building a level in the Sidescroller template. The "2.5D" template, not the 2D one. I want to make it so that the camera does not follow my character up when he jumps and just stays at the same height, like in Super Mario Bros on NES. How can I do that?

Replies

  • Praglik
    Options
    Offline / Send Message
    Praglik polycounter lvl 9
    I'd suggest removing your camera from your Pawn and Controller, creating another actor with a camera inside and moving this one independently.
  • Yog-Shoggoth
    Options
    Offline / Send Message
    Yog-Shoggoth polycounter lvl 9
    You could try setting the camera up as shown in the attached image. This approach gets the camera's world location, breaks the returned vector and zeroes the Z value every tick. Basically nullifying the Z component of the camera's movement. This way you can retain the camera within your player pawn BP and keep using the springarm component to have the camera follow the pawns horizontal movement etc.

    Please note this may not be the most practical solution, I'm still learning UE4 myself, but it worked in my brief test.
  • Amatobahn
    Options
    Offline / Send Message
    Amatobahn polycounter lvl 7
    Easiest way is to have the camera actor pull only the X value of your pawns current position (if sidescroller is travelling on X, Y in the other case) and set the camera's position per frame. To make it smoother you could lerp from previous position to next in case frame rate isn't something you'd like to rely on.
  • Skeletos311
    Options
    Offline / Send Message
    You could try setting the camera up as shown in the attached image. This approach gets the camera's world location, breaks the returned vector and zeroes the Z value every tick. Basically nullifying the Z component of the camera's movement. This way you can retain the camera within your player pawn BP and keep using the springarm component to have the camera follow the pawns horizontal movement etc.

    Please note this may not be the most practical solution, I'm still learning UE4 myself, but it worked in my brief test.

    Thanks, Yog. I had to get familiar with all these terms and learn a bit about working with Blueprint nodes, but I got it working with that method.
Sign In or Register to comment.