Download

2D Platformer Questions: How to keep the camera from moving while jumping & platform-snapping?

Hello again, it’s been a while since I last posted here or have done anything major with Unreal Engine, over a year, I think? Long story short, I was having problems with working on elements of my game due to Unreal Engine’s default character model being a poor stand-in for my main character model, so I decided to shift priorities and instead focus on making my main character model in Blender. Unfortunately, this has taken a lot longer than I originally anticipated and I’ve yet to finish it (I also got sidetracked working on other models as well), the model is almost ready for animation but not quite there yet. In the mean time, I’ve decided instead to revisit working on the game camera since the default Unreal Engine character model should be perfectly fine for the purpose of testing the camera mechanics.

Sorry for the long-winded intro, but anyways, well over a year ago I made a topic regarding a Blueprint I had set up using a series of tutorials I found on YouTube (https://www.youtube.com/playlist?lis…8NQV-r9YMTzLmg) to make a Metroidvania-style camera system to use in the 2D platforming game I’m making:

Icon128.png

This Blueprint worked quite well in establishing the boundaries of where the camera could go & could not go, but there was a issue that Blueprint didn’t address. When the player character jumps, the camera moves upward with the player character which isn’t what I wanted. Rather, I want the camera to remain still when the player jumps upward as demonstrated in these screenshots from Super Mario World:

Icon128.png

I thought I had somehow set up the Blueprint wrong which I why I asked for help here, except that the Blueprint was actually functioning as intended and I that I did in fact have it set up properly. It turned the Blueprint was designed to mimic the camera system used by Castlevania: Symphony of the Night, wherein the camera follows Alucard every time he jumps, whereas I was under the mistaken impression that the camera remained still. I didn’t find out the truth until several months later when I decided to replay Symphony of the Night, it was then that I realized that the Blueprint I had chosen wasn’t going to work in its current state for my purposes. The Blueprint otherwise works perfectly fine as far as I can tell, so if anyone is looking for a Camera Blueprint that accurately recreates Symphony of the Night’s camera then this Blueprint should work.

I’ve tried searching around for any Blueprints on how to keep the camera from moving with the player when they jump, but alas, I haven’t been able to find anything concrete. The closest thing I’ve found so far was this: https://polycount.com/discussion/152…t-jump-with-me, but as I just said, there doesn’t seem to be any concrete details on how to pull this off.

Technically, I could keep the camera from moving with the current Blueprint I’m using by limiting the camera box’s Z-axis to the same size as the screen which is how its done in Symphony of the Night, but this would end up limiting the player’s vertical movement which brings me to the second reason I created this topic.

During my search for info on 2D platformer camera logic I was reading an article on Gamasutra regarding the subject [Link: https://www.gamasutra.com/blogs/Joch…Platformer.php] when I found a link in the comment section to another article [Link: https://www.gamasutra.com/blogs/Itay…h.rncuomopycy0] that mentioned something called platform-snapping.

For those unfamiliar with the term, platform-snapping is where the game camera will realign itself with the platform that the player character lands on, as shown here with these two screenshots from Donkey Kong Country 3: Dixie Kong’s Double Trouble! (The Gamasutra article I linked has better examples that I couldn’t post here because the GIF’s file sizes exceed the maximum limit).

Icon128.png

This is relevant to my interests because right now in the test level I created when the player character jumps up onto the ledge shown in the screenshot below, the player character remains centered on the screen. This not only does this look really awkward but would also be detrimental for platforming vertically.

Icon128.png

Ideally, the camera should realignment itself more like this:

https://forums.unrealengine.com/filedata/fetch?filedataid=157329&type=medium

I was also wondering if whether or not it would a good idea to make these modifications to the Blueprint I am already using. It would feel like a shame to completely scrap it since I do need to place boundaries on where the camera can go and this Blueprint seems to work perfectly in that regard. On the other hand though, it is my understanding that in order to pull off the camera not moving when the player character jumps, and presumably platform-snapping as well, requires removing the camera from the player and I’m not sure how that would affect the Blueprint. Unfortunately, I don’t a good grasp of the inner workings of Blueprints, as most of my experience thus far has been following tutorials, and even then its been quite since I done anything Unreal-related so I’m rather rusty with my limited experience.

I hope that I’m not asking for too much, or that this large wall of text has bored you, but I’d greatly appreciate any help on this matter. I also feel that it not only would benefit me but also lots of other people as well, since I’ve seen quite a few questions regarding platformers here & there doesn’t seem to be a lot of documentation out there for anyone trying to make one with Unreal. When I did a Google search for “Unreal Platformer Camera” the search results came up with the topic I had previously mentioned above as the third search result. This to me was not a good sign, especially since a similar question I had asked on Blender Stack Exchange from the same period was also on the first page. Perhaps the articles in the links I included above can help in figuring how to figure out the camera logic for a Blueprint?

Anyways, I hope that someone will be able help me out and anyone else who wants to do something similar.

Current Camera Boundary Blueprint:
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_116950_1549476360711_177”}[/ATTACH][IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://forums.unrealengine.com/core/image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==”}[/IMG2]​
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_116951_1549476390002_992”}[/ATTACH][IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://forums.unrealengine.com/core/image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==”}[/IMG2]​