Very much UE noob and first timer on the forums. And I hope I am posing the question correctly.
I am working on a 2.5d game in UE 5.3.2 with a slightly tweaked 3rd person template.
When moving left or right the character moves as anticipated and all is well.
What wish to do however is to make the background (which is meshes - which will get animation/lighting etc at a later stage) move with the camera.
IE: I am thinking of it in two “layers” - the front layer is the playable which will extend to the length of my level as need and the second layer is a “static” in camera.
The closest I have seen to this effect is a plane that follows camera rotation and thus always facing the camera. But I was only able to make that work in the context of the tutorial. The main thing being the tutorial is meant for an in scene camera.
I am using the default camera attached to Manny (FollowCamera in 3rd Person Blueprint).
In concept I thought of having 2 cameras. One which is a static focused camera on the background (sub-level maybe?) and “somehow” get that the view displayed (without making the background look flat). Or this could be a very bad idea and there is a much clearer/proper/smart way of doing it.
The other idea is an extension of the plane idea, but somehow to find a way to move (instead of rotate) the meshes/a sub-level.
But my challenge is I have no idea of how to get to FollowCamera and moving the plane instead of rotating.
I still very much a noob, and still coming to grips with a lot of the tools and concepts, so still fumbling around a bit.
See if this helps. Cant really say i fully understand what you are thinking of doing, but if you follow along on videos 3 and up youll get a bit of a crash course in camera management for the engine, as well as some trig basics mixed in.
Ps: if the meshes in background move along, and the character moves along… then isn’t that like not moving the camera at all?
Anchor the player in place, change ABP to work not based on speed but based on button presses, and you can get the same final result without the resource expenditure and bugs you’d get by trying to move stuff along…
Thank you for the feedback. I will work through the videos and see what I can learn, as I am sure I will pick up a few tricks for the future even if not immediately applicable. As for you PS. That is another approach I thought of as well. Anchor everything and only move the floor and spawn enemies/meshes which moves with this floor. I am however such a noob I would not how to start by doing as you suggested. (ABP blueprint I picked to be the animation blueprint.)
Apologies for nothing being to clear as I struggle convey concepts. For more clarity, I created an image which will hopefully explain things better. The orginal idea was to have all the blue actors move and the red static. But as you suggested the inverse should be more approriate. Thus all the blue actors/meshes is anchored (allowing some movement/offset for the player character itself when running left or right) and all the red actors moves as the player “moves” left or right.
As my background scene is a set room everything between wall1 and wall 2 should always be in the camera view. And wall 1 is always in view on the left side of the camera viewport and wall 2 always the right side of camera viewport
I guess that if you don’t need physics happening on background stuff you could attach the objects to the camera.
Its harder to move the red because the character has to walk on it.
The more stuff gets into blue, the less performance you’d get.
An empty room is not a problem.
1000 instances becomes a problem.
If you don’t want that problem, then don’t even use the character class.
Have your controller move the floor.
Have the character animatiom react not based on speed, but based on button presses.
You can get more than accurate start/stop moving that match up the floor movement because you are in full control of the floor speed.
Basically make animations that handle the same speed steps.
If the game is just a sidescroller infinite runnuer sort of thing, then you don’t even need to start and stop… which is even better?
Maybe this is best in terms of character gate/speed etc.
Instead of moving the floor based on input - move the floor based on character animation.
To do this you animate wile moving the root, then you take the axis value to a curve, and remove the root movement.
From then on, the curve marks the exact distance your character is supposed to be at given a specific frame.
You then use that curve value to shift the floor/red by that alpha.
Thank you for the insight. I have not gotten around to sitting down with this again, but hope to do so shortly. Once I do and get it figured out I will give some feedback and some insight to the approach I used.