Tilemap One Way Platform Stuck in Between and Falling Through

Hello,
since the beginning of time i have always the same problem. Sometimes it solves itself but i really don’t know how to actually fix it. So my problem is, that i have some platforms in my tilemap. Sometimes i am stuck in between the platform. Sometimes walking on the thinner platform makes me fall down. Not in the GIF unfortunately is, on the right side when in between of the two thin platforms i cannot jump anymore. i am completely stuck…Does anybody maybe know what the problems are? :frowning:
7090981--844471--UnityOneWayPlatformer.gif

This are my settings for this tilemap where only the one way platforms are in. Pretty default. Can’t see anything wrong?

This is the Rigidbody of my player.

7090981--844477--upload_2021-4-29_18-55-37.png

Any suggestions what could be wrong? :-/

Perhaps you could try changing the Geometry Type of the CompositeCollider2D to Polygon? Outlines generate edges for collision, where your character could jump and walk on the lower edge of the platform when you expect it to jump up or get bumped up to the higher edge due to collision. Let us know if that works out for you!

thank you for your reply! i tried that. it fixed the problem with the THICK platform so i want walk on the lower edge of the collider.
but i still have the problem with the thinner platforms, falling through :frowning:
i added new GIF. i am falling through the thiner platforms, AND i also made the collider thicker than the platform but that diddnt help. and on the right side i am stuck between the platforms ALTHOUGH it should be a one way platform…doesnt make sense? why would i suddenly be stuck if its a one way platform :smiley:

7093318--844885--UnityOneWayPlatformer2.gif

That is interesting. How thin are the thin platforms? Would it be possible to have a screenshot of the colliders of the thin platforms in the SceneView? Having them zoomed in would be great!

previously they where much thinner, same size as the sprite, so i made them thicker but it didnt help. its even almost the same size like the huge platform but only on the thin platforms i fall through. lol.

7093417--844894--upload_2021-4-30_9-55-34.png

7093417--844891--upload_2021-4-30_9-54-17.png

Sorry, I guess I can’t tell what the issue is. If possible, could you file this as a bug with your project using the Unity Bug Reporter and post the case number here? This will help us look deeper into this. Thanks!

Case Number is 1332897 i guess :slight_smile: thank you! =)

A PlatformEffector2D is designed to work with a single simple collider. Assigning it to work on the whole of a TilemapCollider2D isn’t really what it was designed for. Effectors were around long before the tilemap stuff. In the end, if those “platforms” allow you through them, then so would the “roof” of the same tilemap (it’s the same collider) although obviously you can design that away. The side-walls are affected by the same PlatformEffector2D. These “platforms” are not separate platforms either, they’re the same single collider.

The next question might be; how then can I do one-way stuff on a tilemap for tiles or groups of tiles? The answer is, we don’t have anything that adds such behaviours on specific tiles or groups of tiles! The PlatformEffector2D looks at an incoming contact and determines if the normal means it’s the surface or sides. Modifying the Transform using scale means those colliders need to be recreated as there’s no scaling internal to the physics engine (Box2D). This means the contact will be re-evaluated inside what you are logically wanting to be a box but isn’t I presume because it’s just an outline which has no interior.

In short, you are treating those as platforms (plural) but they’re actually (from what I can see) a single logical collider platform which you want treated separately.

One way behaviour on such complete objects is only going to happen when we expose contact modification which is (or will be shortly) on the road-map. This allows you or another party to create your own behaviour with contacts such as disabling them with your own logic and/or changing the friction/bounce and tangent velocities etc.

1 Like

Wow, thank you for answering. So currently the solution would be to make an seperate Gameobject for the thinner Platforms or ANY platform at all, that should have the one way function and then add it to the tilemap with the GameObject Brush. That would probably solve the problem! THANK YOU!

It would certainly work because this is what the effectors were designed for although it’s not clear why you were seeing what you were seeing.

Hey, this sounds like the exact solution I’m looking for, but I was not familiar with the GameObject Brush… did some Googling around, so to anyone running into this and wondering how to find it, it’s in the “2D Tilemap Extras” package which is available in the Package Manager, but you have to have “Enable Preview Packages” turned on in order to find it in the registry. Happy hacking!