• 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 Chapter9 · Apr 30, 2010 at 03:12 PM · physicsmaterial

How come Physic Materials parameters appears to do nothing ?

Hi,

I've been trying to do a moving flat horizontal platform using a kinetic rigidbody but when I put another rigidbody based object on it, it slides. I tried creating a super sticky material and assigned it to both objects but changing any of the parameters does not seems to affect anything. I would like to stack up a tower of blocks on that moving platform without them falling down but still retain their physical behavior.

To reproduce the problem I created a simple scene where I have:

  • One flat platform with a kinetic rigidbody
  • One Cube with a rigidbody
  • One Super sticky material which I assigned to both objects
  • And this script on the moving platform:

public class Shake : MonoBehaviour {

 void Start () {
 }

 void Update () {
     float sinTime = Mathf.Sin(Time.time);
     float cosTime = Mathf.Cos(Time.time);
     transform.Translate(transform.right * sinTime * Time.deltaTime);
     transform.Translate(transform.forward * cosTime * Time.deltaTime);
 }

}

Should I add a force of some kind to the objects on the platform (the energy of the moving platform) ? I thought creating a super sticky physic material would have done the trick...

Thx for helping me

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Chapter9 · May 15, 2010 at 04:43 AM

The solution couldn't be more obvious but just in case someone end up on this questions and can't find the answer, here it is...

According to Unity Rigidbody Documentation we need to use Rigidbody.MovePosition:

For kinematic rigidbodies it applies friction based on the motion of the rigidbody. This lets you simulate moving platforms with rigidbodies sitting on top of the elevator. If you want other rigidbodies to interact with the kinematic rigidbody you need to move it in the FixedUpdate function.

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 Chapter9 1 · May 12, 2010 at 09:45 PM

OK, I made a lot of tests and...

When the IsKinematic flag is enabled, moving the platform does not propagate the translation force of the moving platform on objects colliding with it since in Kinematic mode we are translating objects using transform.Translate and not using rigidbody.AddForce... which make sense... Surprisingly, the torque is still applied. Not sure if this is a bug or a feature...

Anyway there's is in fact two solutions for this:

The first one is to disable IsKinematic flag and gravity and start using rigidbody.AddForce instead of transform.Translate. Now, by doing that, this results in other problems when other objects collides with the platform but we can manage it by canceling their effects.

The second solution is to stay in Kinematic mode. By computing the delta translation between frames we could compute a force that would be applied on all colliding objects. Which would require to keep a list of objects and on...

I'm going to test theses solutions and see where it gets me... I'll post my findings.

p.s. I've heard about Unity 3.0 updating the PhysX engine... maybe there's a solution in waiting.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

UnityEditor > Assign a Physics Material from asset folder to colliders component of objects 1 Answer

Getting realistic bounces using physics materials. 2 Answers

Create new Physics material via C# script 1 Answer

Keeping rigidbody upright in relation to slope 2 Answers

how to change physics material of a colider in runtime 5 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