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 /
  • Help Room /
avatar image
0
Question by CH3DD4R · Jan 13, 2016 at 02:19 AM · rigidbody2dcollidersphysics2d

Dealing with weirdly shaped character (2D)

Ok, so I've got a movement script up and running, but I get the model for the character and the head is hugely oversized. Here he is. alt text

What I'm trying to accomplish here is movement where the collider ends at the feet, so that you can't hand off an edge very unrealistically. I also want the head to collide right with the world, for example, hitting his head on a ceiling when jumping. I tried a polygon collider, with slopes at the edges to push it out so that the head collides right, but it creates a weird drag because of the physics.

So my question is basically this; Can I get rid of the drag when using a polygon collider, or will I have to use a raycast to push the player away from the wall?

polychrome-guy.png (13.4 kB)
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 dotfortun3 · Jan 13, 2016 at 03:38 AM 0
Share

You could try setting the drag and friction of the collider to 0f, and then control the deceleration yourself. You could also do something that enables drag when the character is jumping and set it to 0f when the player touches the ground, so the movement feels natural.

avatar image CH3DD4R dotfortun3 · Jan 13, 2016 at 05:05 AM 0
Share

Well unfortunately, I've already set Angular drag and Linear drag to 0, and the Physic$$anonymous$$at for the collider has 0 friction and 0 bounce.

avatar image CH3DD4R · Jan 13, 2016 at 05:29 AM 0
Share

I know found out that using a collider like I mentioned is not going to work. You can use the ramp on the side to shoot the character into the air without jumping. I will probably have to go the raycasting route.

avatar image MelvMay ♦♦ · Jan 13, 2016 at 08:52 AM 0
Share

but it creates a weird drag because of the physics

What does this mean? Linear Drag affects the Rigidbody2D velocity and isn't affected by the colliders, nor does it relate to the mass of the body either. Angular Drag also affects the Rigidbody2D angular velocity and relates to the mass and it's position relative to the body. Colliders do affect the center-of-mass though but you can set that explicitly if you want. Neither linear/angular drag relate to contacts though; they are applied regardless of contacts. I see you commented on the physics-material which only comes into effect when in contact with something i.e. contact friction/bounce. $$anonymous$$aybe if you spent more time clarifying the actual problem (what is 'weird drag') then we can help you.
avatar image CH3DD4R MelvMay ♦♦ · Jan 13, 2016 at 04:17 PM 0
Share

I'm sorry, I guess I wasn't that clear. It seems clear to me, but then again, I already know the problem, so...

The "drag" problem is fixed, but I'll clarify anyway. When standing on the edge, past the feet, since there was an angular collider there that pushed the player away from the edge, so that when it was falling, even though there was no friction, it didn't slide all that smoothly, certainly not as smoothly as needed. It had a kind of drag it seemed. However, using Interpolate ins$$anonymous$$d of Extrapolate helped, for some reason.

0 Replies

· Add your reply
  • Sort: 

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

39 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

Related Questions

rigidbody not moving 1 Answer

Player Movement and SurfaceEffector2D 0 Answers

How to make instantiated rigidbodies continue moving the in the same direction as destroyed object? 1 Answer

RiigidBody2D.AddForce() isnt working at all. 0 Answers

How to Stop Collider from Moving? 2 Answers


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