I marked as C++ Programming cause I am trying to use C++ as much as possible as a way of getting a better knowledge and feel of the language.
Okay, first things first, I’m gonna explain what I want. I am making a platformer game, much like the Megaman X series. In those games the camera follows the player around, almost every time making the player character stay around the middle of the screen, however, when you reach, say, the ground or the corners of a room, the camera stops following you and remains static, as to not go out of bounds.
Hey there, i would probably do something like this: I would maybe define a box component that would serve as the bounds for the camera’s position (so that you don’t have to hardcode values). Then on the camera’s actor tick i would be clamping it to be inside the bounds.
The box collider is not supposed to collide with camera, it’s just a way to define in 3d space the place where the camera can move, you have to defined that in the tick. I know the camera is attached to a spring arm, but is that on the players blueprint?
The camera is attached to a Spring Arm. It’s the default from the Sidescroller template. I tried using the box collider, but the camera still clamps inside the invisible wall I’ve put there for it to collide, trying some different stuff now
If you dont want to use the box collision you can manually define the Min and Max Limit in world coordinates, so you just make sure that your camera is always inside those values.
Yes but you did not understand the box collision idea, the idea is just to have a volume that surrounds to world, it’s not supposed to have any collisions, it’s just serving as a volume.
Every tick you would be forcing the side axis (does the camera move horizontally in the Y axis?) of the camera to be within the box world position ± the extent.
It’s the translation that comes from the rotation of the camera by using the spring arm. Is it possible to send a gameplay picture so i can visualize better what you are trying to do?
Yeah that’s what i thought, the camera blocking volume will block the camera but for horizontal movement it wont work very well. I tried implementing my approach, but with hardcoded values like: