tl;dr
I see two possible solutions.
- if you have a player object that already moves from lane to lane, then parent camera to that object, it will move to the lane, when the player moves
- if you don’t have an object that already moves from lane to lane, then try checking whether SetLocationAndRotation is being called at all. If Direction variable is not set to Center then it might not be
Longer version
Hey, I’m not that proficient with the blueprints, but let’s see if I understand yours correctly.
You remember which lane you are currently in (Switch on Name, or is it where you wanna go?) and in every frame you set position of the camera based on the player’s position. If this is the case, I might have a bit of a trouble understanding how you swap lanes if you are not in Center lane. What purpose does it serve in first place?
In the second part you change variable CameraOffset that you use to move the CameraActor. I’d probably check whether CameraOffset changes each frame (see what you are plugging into Make Transform node) just to be sure. This should also help you check if the SetLocationAndRotation method is being called at all.
I see a possible problem here, but can’t see if it’s "it’. When does the “Direction” changes (Left, Center, Right)? Is it when player moves from lane to lane, or when camera does? Does it change at all? If it changes when player moves, then it might be that the methods to change camera lane are never called.
If this is true, then there’s a couple of solutions that might be more efficient for you. Thing is, there’s no need to do the lane swapping in Tick function (and it’s a good practice to only keep functionality that can really differ on per-frame basis in Tick for performance reasons). Instead, you can move the camera in the same function where you change CurrentLane variable (or wherever you change Direction variable). This will only get called when necessary (I assume when player pushes a button)
However, if you already have a player object that you can move from lane to lane, try adding the camera to the blueprint of the character. This could save you lot of trouble, as the camera will move every time the player moves (that is in any direction). Check Third Person Character to see how it can be done.
Hopefully this helps you, and hopefully I got what the BP does for the most parts. Cheers