• 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
Question by deets · Mar 25, 2014 at 10:39 AM · rigidbodystaticfrictiondrag objects

Object not moving with ground with physics material.

So I basically have 2 objects, one being the hero on a snowboard with that snowboard being used to check different grounds it is sliding over or to activate triggers. The other being a circle shaped magnet that is rotating.

The result I'm trying to get is when the hero enters the trigger of the magnet it gets attracted to the magnet. When it's stuck to the floor of the magnet it should rotate together with the magnet. I got everything working except for the rotating part. The hero is stuck to the magnet but stands still on one position with the magnet rotating underneath the board.

So a bit more in detail. the board has a rigidbody component and underneath (child) a gameobject with a capsule collider so I would be able to check if it enters the collider of the magnet.

The magnet has 2 gameobjects underneath it. One with a collider that works as a trigger and the script for attraction where I change the gravity of the world into a point gravity towards the magnet calculated with the position of the hero and position of the magnet when entering the trigger. The other gameobject is a ragespline that holds a physics material with static friction so it won't slide over the circle and in my opinion should drag the hero along when rotating since it actually does prevent the hero from sliding, but the dragging along doesn't work.

I have tried modifying the physics material, modifying the rigidbodies drag and angular drag. But nothing seems to work to get the hero to rotate with the magnet. Anyone who has an idea or can help me out?

Comment

People who like this

0 Show 0
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
Best Answer

Answer by Dblfstr · Mar 25, 2014 at 02:42 PM

If you are moving the magnet by its transform.position, there will be no collision interaction. You have to use forces to move rigidbodies. It sounds like your magnet or ragespline (whichever needs to 'move' the player) needs a rigidbody and its movement should be controlled by AddForce, or AddTorque, etc.

Comment
screenname_taken

People who like this

1 Show 5 · 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 deets · Mar 25, 2014 at 03:29 PM 0
Share

I actually read this already when searching before asking this question. But the AddTorque didn't seem to move or have an effect on my magnet at all. I'll give it another go and keep at it till the thing is moving with AddTorque.

avatar image deets · Mar 26, 2014 at 09:26 AM 0
Share

This actually did the trick :) thanks for the feedback :)

avatar image Dblfstr · Mar 26, 2014 at 01:38 PM 0
Share

Glad it worked. If the questions is adequately answered, please mark it as such and close it. :D

avatar image deets · Mar 27, 2014 at 08:04 AM 0
Share

Since this is my first question not sure how to do that xD

avatar image Destran · Mar 27, 2014 at 08:09 AM 0
Share

Little grey circle with a checkbox in it underneath the thumbs up/thumbs down.

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.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

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

RigidBody Jitterbug Question.( PhysicMaterial.Static) 2 Answers

Wrong gravity calculation? 2 Answers

Can't use Rigidbody or Character Controller 0 Answers

Friction Problem 1 Answer

rigidbody friction problem....HELP!! 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