United2d create one side collider

I have a demo version of a card game.

I need a character that can jump through the collider on one side.

the collider in my character and land is as follows:

symbol: capsulecollider2d

earth: polygoncollider2d

enter image description here

so that the symbol can stand on the ground

enter image description here enter image description here

can also jump to the ground

but now I want the symbol to jump from the bottom of the earth, it cannot work

enter image description here

So how can I solve this problem? Is there a configuration that can force the collider to have only one side?

------------------------------------- 2017 08 11 ------- --- ---------------------------

Many thanks to everyone

thanks @EmreE @Jeroen De Clercq

I solved this problem using Platform Effector 2D provided by @EmreE

enter image description here

first: add a 2d effector platform to my land and select "use one way"

second: select "Used by effector"

enter image description here

now it works :)

enter image description here

+5
source share
1 answer
  • Put your floor in a layer;
  • add your platforms to the layer;
  • When you jump, remove the collision with the platform level until you reach a direction that points to the floor.
  • When you press the Delete key, delete the collision with the platforms until you have completed one level of the platform.

Additional information here; https://docs.unity3d.com/ScriptReference/Physics.IgnoreLayerCollision.html

+3
source

Source: https://habr.com/ru/post/1270753/


All Articles