Help with blueprint for platforms that are passable from below.

Recently, I’ve been attempting to make platforms that the player can jump through from below like in other platforming games such as Mario & Sonic, but I’ve run into some problems while attempting to do so.


Currently, when the player attempts to jump through the platform, they pass partially through but are then pushed back down to the ground. Another problem with the blueprint is that requires the player to first jump onto the platform from above in order to trigger the effect.

I’m not sure how to get the blueprint to work in the way that I intended, and my past attempts at trying to find tutorials online hasn’t yielded much. I’ve found it surprisingly difficult to find any detailed tutorials on how make a sidescrolling platformer in Unreal Engine using the 3D engine, so any help with matter would be greatly appreciated.

Blueprint Viewport:


Platform blueprint:

1 Like

create 2 collisions box’s on on top that starts near the center of the platform and stands slightly over the top, on end overlap for the top box sets the collision on.
the bottom collision box is somewhat larger to prevent you from colliding and here you deactivate collision on start overlap.

Thanks for the help, the platform blueprint is now working as I intended to, aside from the occasional instance when the player hits the side of the platform when jumping at it from the left or right sides. I’m guessing that I have to adjust the size of the collision box to fix issue.


However, aside from minor problem everything else seems to be in working order, although I do have one more question that I’m hoping I can a response to.

My question is related to the fact that in most platforming games when the player jumps through a platform, the player’s sprite will always overlap the sprite of the platform. Donkey Kong Country: Tropical Freeze managed to pull trick off and I’ve seen the program Blender do the same thing as well with overlapping 3D models, so I know can be done with 3D graphics and not just 2D sprites. I was wondering if it is at all possible to implement visual trick with Unreal Engine rather than simply having the player clip through the platform.

Regardless of whether or not I can get a response regarding the player visual overlap question, thanks again for the help with figuring out the platform box collision.

You could disable collisions on the platform when player.Z is lower then platform.Z, it would be cleaner imo…

As of the second question… you should look into custom depth, you could use it to create “the trick” you want.
I believe there was an example in “Blueprints” or “Content Examples”. Or you will find some good tuts around forums.

Is it possible to explain in more detail? I don’t really have a great amount of experience working with Unreal Engine 4, having only been working with the engine for about half a year. I based blueprint off of one that I had been working on for a online course I’ve been taking for the past several months. Since I would like to eventually make a full 2D-style platforming game, I thought I should experiment with modifying the blueprint from the course to see if I could utilize it for own purposes, but unfortunately due to my own inexperience with much of Unreal’s functions, I was unable to figure it out on my own, hence why I came here for help. By coming to place I was hoping to not only how to get the platform blueprint working the way I want to, but also gain a better insight into the functionality of Unreal’s blueprints so that I could eventually learn how to pull off much more complicated effects with the engine.

I tried doing a Google search for “custom depth”, as well as searching YouTube for videos for help, but thus far, I haven’t had much luck in anything that explains how to use custom depth in the manner that I want.

I’m not sure what you mean by examples, do you mean that I can find examples within Unreal Engine on how use custom depth, or you mean forum or another one?

Go to the ‘learn’ tab in unreal’s launcher. You should find the projects named ‘Content Examples’, 'Blueprints, and ‘Platformer Game’ useful. Content is especially large, and I’ve found it very helpful to look at.

2 Likes

[USER=“516246”]Hungry Moogle[/USER] If you fake the mesh out its easiest. Create a 5 sided box without the bottom, and set collision to one sided. Okay you can jump through. Easy. Now fake the geometry, and make a bevel around the bottom so it looks like it’s still a box, or group 2 meshes together one without the bottom, and disable collision on bottom mesh. Your good.

I crawled out of my comfort zone and dedicated few minutes of my precious time to show you quick example :smiley:

  1. Create Actor Blueprint (call it for example Platform_BP)

  2. Add Component **Static Mesh **(no need to choose any atm, but I would choose at least 1m_box or something for visualisation purpose) and drag it over DefaultSceneRoot

  3. In Event Graph create the script I uploaded above (or copy/paste from here: blueprintUE | PasteBin For Unreal Engine )

  4. Place Platform_BP in your level (you can change mesh in Details -> Static Mesh) and try it out

Of course is (too) simple solution and would need some tweaks to work like you would like to, but at least you know what i meant.
Personally I would choose solution because you will just use one BP all over your level and just change the mesh to required one and if you make any changes, you will affect all the “passable” platforms.

As salm mentioned, there is “Learn” tab in launcher with some nice examples of many engine features.

I Googled out little example from answer hub: Make actor visible through walls? - Rendering - Epic Developer Community Forums

2 Likes

Thank you very much for going to the effort making that blueprint example, but I have a couple of issues with it. Firstly, there’s a weird ‘skipping’ visual glitch that occurs when you land on the platform after jumping through it. Secondly, I’ve encountered a bug with the blueprint that appears to be triggered when the apex of the player’s jump is within the middle of the platform. Triggering bug results in the player becoming stuck in place in the middle of the platform, unable to move in any capacity. And lastly, I still have problems with the player occasionally colliding with the sides of the platform when jumping at it from the left or right.

I think 's solution has been the option that has worked out best thus far, as it appears to work perfectly aside from the issue mentioned above of the player on occasion colliding with the platform’s sides. issue of colliding into the sides of platforms isn’t a major problem, but it is still a problem that bugs me nonetheless, largely due to the fact that it occurs in an extremely inconsistent manner. Why do I consider an issue that needs needs to be dealt with? is a question that I think that would probably be best demonstrated with the following two pictures below that I quickly made in Paint to act as a visual aid:

Picture #1.)


Picture #2.)

The hallmark of good controls in a video game is that the player should be in control 100% of the time, that a button pressed only responds 50% of the time is poor design. I feel that principle applies to my platform blueprint and that when the player jumps towards a platform from the left or right sides, they should either pass through the platform 100% of the time or not at all.

I’m not too familiar with how all of stuff works, but I assume the problem stems the player is hitting the ‘TangibilityON’ collision box, instead of the larger ‘TangibilityOFF’ box directly below it, but I can’t say for certain whether or not that is the case.

the reason why you hit the side is that your lower collision box is to low, so it only works if you hit the side low enough.

if you still hit the side, print out both Z values and based of that subtract some of your player Z until you dont get stuck, but still dont fall through from the top

I tried implementing blueprint, but I’ve run into a problem where the game crashes when the player attempts to jump through the platform from below. The game won’t crash if the player jumps on top of the platform or if they jump at it from the side, although the player collides with it rather pass through it like they should.

Also, the following error appears in the Unreal Engine’s Message Log:

  • Infinite Loop detected in Platform1, asserted during Set Collision Enabled with the following Call Stack

While the Call Stack reads:
Script call stack:
Function /Game/Objects/Platforms/Platform1.Platform1_C:BndEvt__BoxCollision_K2Node_ComponentBoundEvent_0_ComponentBeginOverlapSignature__DelegateSignature
Function /Game/Objects/Platforms/Platform1.Platform1_C:ExecuteUbergraph_Platform1

I have no idea why problem is occurring as I can’t seem to find any problems with the blueprint itself. Is there something I overlooked, or is there some other thing at fault?

you deactivate the collision of the Box Collision while you want to deactivate the collision of the Platform and you will most likely need to add an Offset since the Player Z is probably around the hip or use the Z of the Character Mesh which should be by the feet.

2 Likes

What is Offset? I can’t seem to find it anywhere, I tried dragging from the B Float pin of the Subtraction component but I couldn’t find any Offset options. I then tried right-clicking in an empty area and typing in “Offset”, where I then got various options such as AimOffsetBlendSpace and AddLocalOffset but nothing that resembles the Offset component shown in your example.

its a float variable i created to easier change the needed offset, if you dont want a variable simple type in your needed offset into the B Float pin

The game continues to crash with the exact same error message as before:


I have no idea what’s causing problem or how to fix it.

like i said you change the collision of the wrong component, you want to change it for Platform but you change it for the Box Collision

Okay, now I understand what the problem is. I changed the target of both instances of Set Collision Enabled to the Platform component instead of the Box Collision component and now the blueprint is working as it is suppose to.

After playing around with the Z Offset a bit, I’ve managed to eliminate colliding with the sides of the platform, however, in fixing problem, another one has emerged from the solution to the previous problem.


The new problem is shown in the picture above, with the player character being unable to leap unto the shown platform, falling through it instead of landing on it, as I previously could.


The thing about it though, is that its not a problem with the blueprint setup for the platform itself, as shown in second picture, the player is able to stand on top of the platform I placed at the start of the level.

The source of issue would appear to be that the very bottom of the player’s collision capsule must make contact with the top of the platform’s collision box in order for the player to properly land on top of it. If the bottom of the player’s collision capsule misses the top of the platform by even the slightest, the platform’s collision will fail to activate, causing the player to fall through it instead. I’m not sure whether or not if issue can be corrected by adjusting the Z Offset, I currently have it set at 150.0, or if I have to add some further alterations to the blueprint to compensate for the overly sensitive collision detection between the player and the platform.

is your Platform collision by default Off? it needs to be On otherwise you fill fall trough. As its setup now it assume that collision is On and only switch it Off when you come from below/side.

I don’t think so, but I don’t think is an issue regarding the platform blueprint in either it’s implementation or it’s setup.


If I lower the platform that I’m having trouble with down a bit, then the player character can land on top of the platform without falling through. As I said in my post above, the problem I’m having seems to be with the player character’s collision capsule rather than the platform itself.


To better illustrate the issue I’m having, take a look at screenshot. In screenshot, the player character is unable to land on the surface of the platform despite 90% of the player character’s body being above the platform.


However, if I lower the platform down a bit like in the first screenshot, then the player character is able to jump through the platform and land on its surface. Thus, I would have to conclude that the reason that the player character was unable properly land on the platform was because the player character’s feet weren’t touching the top of the platform.

It just seems rather ridiculous to me that the player character can’t properly land on the platform just because a tiny portion of their body isn’t making contact with the platform’s surface. I feel that the default Unreal player character’s collision capsule is probably too long and narrow, although I’m not sure how to check the collision box of a model while its moving in order to confirm theory. It doesn’t help matters that I don’t have any other different models with differently-sized collision boxes that I could use for testing rather than the default Unreal model. The final model I intend to use for my project is still a work-in-progress as I still need learn the intricacies of 3D modelling and animation before it is in anyway usable.

is misunderstood you previous post.
you can set the collision capsule visible by selecting it on your character and than deselect “hidden in Game” under rendering.