Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by LazyDog_Rich · Oct 04, 2017 at 03:47 AM · 2d game2d-platformercollidersplatformsstairs

How to make a 2D stairs you can walk by

Hi, I want to make a 2D stair, that can be walk through, and only walk over it if you "land" on it. I mean if you fall on it, or if you are next to it and just jump and land on it.

Is a regular kind of stairs of 2D But I dont know how to achive this.

I try using Plataform Effector but this dosent work

Here's a image of what I want to achive alt text

There's a lot of 2D using this stairs, now I only can think on room13 alt text

stairs.png (137.3 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kikrim · Oct 04, 2017 at 03:19 PM 0
Share

Did you try changing rotational offset, or surface arc ? And you could move up bottom edge of stairs collider.

avatar image LazyDog_Rich kikrim · Oct 04, 2017 at 03:37 PM 0
Share

Yes I try changing all the values of the Platfor$$anonymous$$g component, but nothing worked. I try rotating the Platfor$$anonymous$$g, to match the stair collider inclination, and change a lot of values and test. If I can make the player go through the stairs, then I cannot land on them anymore. If I can walk over the stairs, the player cannot walk through them. I tried a lot of different combinations but nothing worked :/

In the stairs Im using a Edge collider 2D a simple line from the bottom to the top

avatar image TharosTheDragon · Oct 04, 2017 at 04:37 PM 0
Share

It would help to know what you're doing now and what behavior you're experiencing. Is your character climbing the stairs when they shouldn't be, or falling in front of the stairs when they shouldn't be?

If your game knows when your character is walking versus when your character is falling or jumping, then surely your game can use this information to deter$$anonymous$$e how to interpret a collision with stairs.

avatar image LazyDog_Rich TharosTheDragon · Oct 04, 2017 at 07:13 PM 1
Share

Well this is a good idea. Yes the game will use raycast to check if is grounded. Y may use this like OnCollisionEnter(stair) if(playerGrounded) ignorecollision

I had an answer on the forum that I could use trigger in the bottom of the stairs. I gonna try both ways and see which is better

Forum answer: https://forum.unity.com/threads/help-please-how-to-make-a-2d-stairs-you-can-walk-by.498640/#post-3243309

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by kikrim · Oct 04, 2017 at 05:56 PM

I tried with moving up bottom edge of collider. This should also work for you. I have different angle of collider, because my character could slide down

My soution gif
link to my video

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image LazyDog_Rich · Oct 04, 2017 at 06:42 PM 1
Share

Ohh that should work, the only problem I see is that when you are walking down a stair, you will fall in the last steps. In the videogames that use this kind of stair that does not happen. I wonder how they achive this :/ Anyway this will work, thanks!

avatar image LazyDog_Rich LazyDog_Rich · Oct 04, 2017 at 06:58 PM 0
Share

I got a different answer in the forum that may work better. Here's the link: https://forum.unity.com/threads/help-please-how-to-make-a-2d-stairs-you-can-walk-by.498640/#post-3243309

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

79 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Player getting stuck between grounds 0 Answers

Way to achieve 3 lane mechanism in a 2D game 0 Answers

Tilemap Collider 2D not generating colliders...,Tilemap Colliders won't generate.... 0 Answers

Softbody physics with 2D sprites 1 Answer

physics.OverlapSphere colliders 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges