Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

2D Platformer Gameplay

Discussion in 'Game Design' started by GiorgioK, Aug 17, 2022.

  1. GiorgioK

    GiorgioK

    Joined:
    Oct 20, 2021
    Posts:
    24
    I'm making a 2D platformer with rooms/floors.
    Between floors, you can go up the ladder through a vertical passage.
    When a player climbs a ladder, they can jump from one ladder to another.
    The passage is initially closed by two doors - top and bottom.
    When the doors are closed the player can walk on passage.
    Untitled-1.jpg

    After opening the doors, a small collider remains at the vertical passage,
    so that the Player does not fall into the passage.
    Untitled-2.jpg
    When the player clings to the ladder, I turn off his RigidBody so that gravity does not affect him:
    rigidBody.isKinematic = true
    At the same time, it can pass through colliders.
    Up to this point, I'm fine with it.

    BUT. If the player jumps or unhooks from the ladder while the passage collider is crossing it
    approximately in the middle, then it will hang.
    Untitled-3.jpg

    Now a question about the gameplay. How to do it right:
    1) Leave the collider to pass and do something so that the player does not have a conflict with it
    (for example, preventing the player from unhooking from the stairs when the player crosses the collider for the passage).
    2) Remove the collider for the passage. Then the player will have to jump over the passage to get to the opposite side. It seems to me that this will not be very convenient for the player.

    Or some third option?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    2,797
    Not_Sure likes this.
  3. GiorgioK

    GiorgioK

    Joined:
    Oct 20, 2021
    Posts:
    24
    Thanks for the answer.
    PlatformEffector2D is really the solution to my problem.
    Now everything works as I wanted.
     
    spiney199 likes this.
unityunity