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 ZacGarby · Sep 04, 2015 at 07:27 PM · 2draycastjumpplatformer

How to determine if the player can jump, without using raycasts. (2D)

In a 2D platformer, how would I check if the player is touching the floor without using raycasts. It has to be only if the bottom of the player is touching.

Comment
Add comment · Show 5
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 kingcoyote · Sep 04, 2015 at 07:47 PM 0
Share

Is there any reason in particular you are opposed to raycasts? They work very well in this situation and I think any answer given would need to know why raycasts don't suit you here.

avatar image ZacGarby · Sep 04, 2015 at 08:02 PM 0
Share

I don't want to use recasts because they aren't very reliable for this. I've already tried...

avatar image kingcoyote · Sep 04, 2015 at 08:08 PM 0
Share

Do you $$anonymous$$d posting what you tried? Ground check raycasts are a common solution to this problem. $$anonymous$$aybe we can help debug your raycast issues, rather than try to come up with a novel solution to a routine situation.

avatar image ZacGarby · Sep 04, 2015 at 08:24 PM 0
Share

Actually I think I have it working now, the problem was the length of the recast...

avatar image kingcoyote · Sep 04, 2015 at 08:25 PM 0
Share

After reading through your code, that was my suspicion as well. It looks like you're raycasting from the middle of your character controller straight down. If the raycast length doesn't work, you can also try adding a child GameObject at the character's feet and raycast from that point. That lets you do a shorter, more controlled raycast that sticks near the bottom of the character.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hairymangoz · Sep 05, 2015 at 07:02 AM

I think this is what you are looking for: https://www.youtube.com/watch?v=2akPDnmSfu8

Comment
Add comment · 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

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

29 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

Related Questions

Using RayCasting to check for floor and ceiling? 0 Answers

Player stucken in the wall while jumping 2D 1 Answer

GetButtonDown not always firing 1 Answer

Multiple keys not detected at once 1 Answer

Jump 2D error 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