• 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
1
Question by Popoid Android · Oct 22, 2010 at 12:23 PM · frictionphysicmaterialmanipulation

Making an object frictionless at the push of a button

I have these two functions for removing and reinstating friction for a physics object, here they are

function removeFriction () { var frictionlessMaterial = new PhysicMaterial(); frictionlessMaterial.dynamicFriction = 0; collider.material = frictionlessMaterial; }

function reinstateFriction () { var standardMaterial = new PhysicMaterial(); standardMaterial.dynamicFriction = 1; collider.material = standardMaterial; }

the problem is, nither of them work. When I told it to print out the dynamic friction it's 0.4, so clearly niether of them have worked even once. I've tried modifying a single material as well, but that doesn't seem to work either. What am I doing wrong?

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
1

Answer by Popoid Android · Oct 22, 2010 at 02:22 PM

wait, no, typically I've solved it as soon as I asked the question. here's the new functions

function removeFriction () { collider.material.dynamicFriction = 0; }

function reinstateFriction () { collider.material.dynamicFriction = 1; }

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

need platforms to move character with them, not take the character through them 1 Answer

Friction doesnt work? 0 Answers

where can I add friction direction 2 0 Answers

How can I change friction of a Physic material in script? 1 Answer

PhysicalMaterial is not changing through my code. [solved] 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges