Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 ARRAYEWHY · Jan 31, 2014 at 03:48 AM · friction

Problem with friction.

I have a platform that Translates when the Player lands on it. The problem is the X movement of the platform doesn't carry the Player with it, making the Player slide right off. I tried adding a Physics Material 2D with various frictions values and changed the Player collider's linear drag but that didn't work.

Edit: Here's more info on the scene.

The character is moved with a simple rigidbody2D.velocity setup. alt text

The platform is moved with Translation with vectors inherited from 2 game objects. alt text

All colliders are box colliders. I'm sure this can be fixed by placing the Player and Platform in the same game object and then moving that, but can I do this with physics?

screen shot 2014-02-04 at 5.52.47 pm.png (55.0 kB)
screen shot 2014-02-04 at 5.51.56 pm.png (41.9 kB)
Comment
Add comment · Show 8
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 Benproductions1 · Feb 02, 2014 at 04:12 AM 0
Share

How are you moving the player? How are you moving the platform? What is your collider setup? What is your rigidbody setup?

avatar image Ashish Dwivedi · Feb 02, 2014 at 05:43 AM 0
Share

Can you attach a snapshot of your inspector of platform?

avatar image supernat · Feb 02, 2014 at 06:47 AM 0
Share

With that snapshot, pleas show the colliders on the platform and character as the character is slipping. I would think you should just increase the static friction. You could increase the character mass or decrease the platform mass too. Are both physics controlled, or is the platform kinematic? For something like this, you also probably want the character's feet to have their own box colliders. A capsule collider has no solid contact area, but I don't know if PhysX is that realistic.

avatar image Benproductions1 · Feb 04, 2014 at 09:36 AM 0
Share

@supernat we don't even know if he's using a rigidbody for movement or a character controller.

avatar image ARRAYEWHY · Feb 04, 2014 at 10:01 AM 0
Share

Thanks for the replies guys! I've updated the question.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by zee_ola05 · Feb 04, 2014 at 11:51 AM

Create a collider trigger on the player, make player a child of platform upon landing...

     void OnTriggerStay2D(Collider2D other)
     {    
         if(other.gameObject.tag == "platform")
         {
             transform.parent = other.transform;    
         }
     }
     
     void OnTriggerExit2D(Collider2D other)
     {
         if(other.gameObject.tag == "platform")
         {
             transform.parent = null;    
         }
     }
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

22 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

Related Questions

OnTriggerStay2D calculate Stay Time before calling other method 1 Answer

Unity3d 2D mode lighting? 1 Answer

How to display Interstitial Ads after a set number of plays 1 Answer

my player slips on ground 1 Answer

How to detect player car overtake of other cars 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