Help with an Audiosurf style "lane system"

Hey, I’m trying to create a game in which you move between lanes, similar to Audiosurf.

The game is aimed at a young audience, so I’m aiming for simplicity of moving between set points rather than having full range of motion.

So far the only way I’ve managed something similar is using A and D to with “set actor relative location” - which doesn’t appear to be relative at all, or at least not in my understanding. It teleports the player to the set coordinates in the world - this means if I set X:0 Y:400 Z:0 - the player moves back to the X origin, instead of not moving on the X at all.

Is there a way of moving the player relatively?

My goal is having the player press A to move the player 400 Units on the Y axis, relative to where the player is, and pressing D to move the player -400 on the Y axis.

Help would be greatly appreciated.

I’m by no means an expert with blueprints, so I dunno why “set actor relative location” wouldn’t work as you want it (can’t test it right now) :confused:
But what you probably could do is use “Set actor location” and use “Get actor location” with a vector addition to add/subtract 400 in Y as input? :slight_smile:

I came here to say the same thing, that should work.

Thanks, that worked flawlessly! Now I just need to get the camera to stay in place, as it’s quite jarring having the camera move lanes too.

Much appreciated.

I haven’t had time to experiment, but would a camera blocking volume in the left and right lanes achieve what you’re after?

Thanks for the reply - that didn’t work, it essentially just pushed the camera close to the character.

I’ve realised the camera is a child of the character, which is why when the character moves, so does the camera. I haven’t found a way of un-parenting the camera.

I’ve attached an image of the game, hopefully that helps explain.

I’d like to keep the camera in the center lane, as it is in the above screenshot, since having the camera move lanes is quite jarring and causes confusion for the player.

Maybe you could use a “Move Component To” to only move the mesh instead of moving the whole actor? Not sure how it works with child-components though.

If you click on the Location label in the Details panel it will toggle to Absolute Location, which means it is no longer relative to its parent (the character). You will have to set its location each frame to make it move forwards with the player though.

Thanks, I’ll take a look next time I’m in engine. Thanks for the help everyone, the community here is fantastic.

I’m really enjoying working with UE4 - it’s allowed me to create things I couldn’t normally create conventionally, since I’m an artist, not a game designer or programmer.

DID NOT WORK FOR ME IN ue4.17 . im setting moveright and then doing what you told