I was wondering if I could get some help with modifying a Blueprint I'm currently using for a project in Unreal Engine.

I am currently attempting to make a side-scrolling platformer game and I'm using a camera bounding box Blueprint to restrict where the camera can move when tracking the player's movement, based on the following series of tutorials on YouTube by JvtheWanderer: How to make a Metroidvania/ 2D Camera Blueprint System on #UE.

The camera bounding box works as intended, in that it prevents the camera from moving beyond the limitations of the camera box placed within the scene, but I want to go even further than that and establish a limitation within the camera bounding box that not only limits the camera's movement but also prevents the player from moving on the Y-axis beyond the box's boundaries.

Pretty much every platformer from Super Mario to Sonic the Hedgehog to Castlevania, have such boundary limitations, usually at the very start of the level and also frequently at the end. The limitation on the Y-axis boundary is also frequently used to lock the player into a particular area for forced enemy encounters, mini-boss fights as well as proper boss battles, a limitation that lasts until the player has vanquished the threat.

I wish to implement similar boundaries on the camera bounding boxes within my project to restrict where the player can go without having to place walls everywhere to keep the player from wandering beyond the level's limits. Using walls to restrict the player's movement is fine for indoor areas, but it ends up looking distractedly out of place in outdoor areas if used in excess.

I've included screenshots below of the Construction Script & Event Graph from the SideScrollerCamera Blueprint I'm using. I would also include the Viewport and the Level Blueprint as well, except that the time being, I am unable post more than two links.

Construction Script: enter image description here

Event Script: enter image description here

Any help with this matter would be greatly appreciated.

  • \$\begingroup\$ Are you asking how to do this, or have you tried and are getting incorrect behavior? If it's the first, you could try using blocking volumes to simulate walls in exterior areas. In general I think this is more of a world design question, since you don't want the player to see walkable surfaces so close to the screen top that it tempts them into jumping. Am I missing the point here? \$\endgroup\$ – JonS Sep 19 '17 at 14:50
  • \$\begingroup\$ I haven't actually tried, I just curious since I recently setup a camera bounding box Blueprint that restricts the camera's movement but doesn't keep the player from being able to wander off from the view of the camera. \$\endgroup\$ – user35500 Sep 20 '17 at 6:49
  • \$\begingroup\$ Sorry, I messed up my above comment and for some reason I cannot edit it. So to reiterate my comment properly: I haven't actually tried, I just wondering since I recently setup a camera bounding box Blueprint that restricts the camera's movement but doesn't keep the player from being able to wander off from the view of the camera. So I guess adding blocking volumes to restrict the player from going out-of-bounds is probably a better solution than adding the restriction into the camera box Blueprint itself? \$\endgroup\$ – user35500 Sep 20 '17 at 6:59
  • \$\begingroup\$ Just out of curiosity, how would one go about restricting the player onto the screen like in the scenario regarding forced enemy/boss encounters described above. I guess you can add blocking volumes that are triggered when the player steps into the area, but how would you go about restricting the camera? Is it also possible to have a trigger that is capable of preventing camera movement for the duration of the battle? \$\endgroup\$ – user35500 Sep 20 '17 at 7:04
  • \$\begingroup\$ The best way to see if something works, is to try it. You lose nothing by trying. So yes, spawning blocking volumes is a valid attempt to solve the issue here. As for restricting the camera during boss fights, that's a fairly simple idea. When the battle triggers, tell the camera to stop following the player. When the battle is over, tell the camera to resume following the player. I have noticed that following other people's tutorials does not teach the why of something, only the how. You need to understand what the camera blueprints are doing before trying to modify them. \$\endgroup\$ – JonS Sep 20 '17 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.