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 Razouille · Sep 16, 2015 at 05:11 PM · 2drigidbody2dphysics2dboxcollider2dphysics 2d

Rigidbody2D is kind of flying instead of falling when the child box is colliding

Hi everyone,

I got a strange issue, everything is in the title, but i'll add some details :

I'm making a 2D side scroller game, the player can move on X and Y axes like in Castle Crashers. So the player has 2 objects : "Body" as parent which contains the Rigidbody2D and a BoxCollider2D, and "Feet" as child of "Body" which contains only a BoxCollider2D, which collides with some walls as you can see here :

alt text

When i press the jump key, the Y position of the "Feet" is stored, and a force is applied to the Rigidbody2D. During the jump, i set the "Feet" Y position with the one stored. On a normal behaviour it works fine, but if i go against a wall (as shown on the screen), during the jump, when the Body is supposed to go down, he flies (the body keeps a velocity of 0).

I guess the "Feet" collision breaks the "Body" Rigidbody2D stuff (i tried by adding a OnCollisionStay2D on the "Feet" object and it's returing true each frame).

Does someone knows how i can avoid that ? One solution is to make a "teleport" of 0.01f on top of the wall, but i would prefer to avoid this solution.

PS : i already have a Physics2D Material with 0 as friction on the player and the wall

PS2 : sorry for my bad english :/

bug-physique.png (9.5 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Driseus · Sep 16, 2015 at 05:16 PM

make the feet collider trigger pls!!!

Comment
Add comment · Show 3 · 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 Razouille · Sep 16, 2015 at 05:20 PM 0
Share

I don't understand, if i set the feet collider on trigger it will not collide with the wall anymore right ? The wall is there in order to avoid the player of going out of the screen (when the camera isn't moving).

avatar image Driseus Razouille · Sep 16, 2015 at 05:25 PM 0
Share

the body collider will collide with it thats enough.

avatar image Razouille Driseus · Sep 16, 2015 at 05:29 PM 0
Share

I could do that yes, but i need a collider which always stay on the player feet, even while he's jumping, in order to detect collisions with small obstacles on the level, depending on the feet position.

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

32 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

Related Questions

Ball bounces at different heights when it shouldn't 0 Answers

Platformer2D Player sticks to platform corners 0 Answers

BoxCollider2D + Edge radius + use auto mass 1 Answer

Using child colliders with rigidbodies/joints in 2D 0 Answers

2D Physics Problem? 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