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 Rembo4Fight · Feb 01, 2018 at 10:19 PM · frictionplatformsslipping

2D Moving platforms is slippery!

Hello :)

I'm having a problem with my moving platforms It seems like it need to move every time when the platform is moving to stay on it. But I want to make it like classic way, that if you are standing on moving platform you don't need to move to stay on it What can cause the problem?

I tried to make a Friction Material with Friction of 10 and give my player friction of 5 at the same time.

Comment
Add comment · Show 3
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 TreyH · Feb 01, 2018 at 10:23 PM 0
Share

A few ways to go about this. If you don't want to use a super high friction coefficient, then making the player object a child of the platform when they are standing on it might be an acceptable solution.

avatar image Rembo4Fight TreyH · Feb 01, 2018 at 10:24 PM 0
Share

I'm not sure how can I make this How can it be done?

avatar image gigaclon · Feb 01, 2018 at 11:48 PM 0
Share

How are you moving your platforms? Are you just moving the transform or applying forces to the platform.

It also sounds like maybe the player isn't touching the platform and thus is not being moved with it. Try putting a Debug.Log statement in OnCollisionEnter (or the 2D variant) in your player controller script and see if you get a collision.

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by The_Icaruz · May 18, 2018 at 05:55 AM

In my game I've added this line of code in my Player Controller Script and add the Tag "MovingPlatform" to the platforms that are moving.

 // Check if the Player is on a Platform and set the Player as child of the Platform
     void OnCollisionEnter2D (Collision2D other) {
         if (other.gameObject.tag == "MovingPlatform") {
             transform.parent = other.transform;
         }
     }
 
     // Check if the Player leaves a Platform and set it back out of Parent
     void OnCollisionExit2D (Collision2D other) {
         if (other.gameObject.tag == "MovingPlatform") {
             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
avatar image
0

Answer by Obsessi0n · Feb 02, 2018 at 12:06 AM

Try to do this: run this in an update -> If player is colliding with the platform then the position.x of the player should be = the position.x of the platform.

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
avatar image
0

Answer by Caliber · May 18, 2018 at 09:20 AM

Depends a bit on how your collision detection works. In this tutorial

the dev has the same issue, and shows how to solve it (using raycasts).

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

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

Platforms lose their frictionless property after dynamic layer change 0 Answers

Stop character sliding? 1 Answer

How to compensate for moving platforms that move side to side 2 Answers

How can I create an animation of platforms 1 Answer

toggle rigidbody constraints? 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