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 Chris 35 · Mar 15, 2011 at 11:08 AM · physicsrigidbody

Rigid body Help Please

Im fairly new to unity so what im about to ask maybe silly but anyways

im using unity 3.2 and im building a 2d platformer using unitys 2d platformer controller. i wanted to add some obstacles in the way of my character Eg a pile of boxes and when my character jumps or runs into them they get knocked over and roll about the place. i dont however want my characters position to be effected. ive tried adding a rigid body to the boxes but they wont fall when the player hits them. and when i added one to the player also the player went "crazy"

So my question really is can my character hit a box with a rigid body and have the box be affected by physics but my character be unchanged.

Any help would be awesome

Comment
Add comment · Show 1
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 Chris 35 · Mar 15, 2011 at 11:33 AM 0
Share

Sorry Everyone i figured it out lol

1 Reply

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

Answer by Kay3D · Mar 15, 2011 at 11:40 AM

Maybe you could add a collider to the object and a rigidbody(so it behaves properally) and then add a script that on the OnColliderHit function you find your character controller and set the position of it relative to where it was just before it hit the object. I dont know if it helps that much! Sorry Im a newbie to Unity too! Great tutorials here might help 3DBuzz Its all the basics of Unity really helped me

Comment
Add comment · Show 1 · 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 JustinTheSwift · Dec 16, 2018 at 07:57 PM 0
Share

I was having the same issue, and this answer pointed me in the right direction. To improve upon it, add OnControllerColliderHit to your CC.

https://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.OnControllerColliderHit.html

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

1 Person is following this question.

avatar image

Related Questions

OnCollisionEnter isn't working between two RigidBodies 1 Answer

Rotating a Rigidbody with Physics 1 Answer

How do I connect multiple spheres using joints and make a character? 1 Answer

Shooting a cannonball. 6 Answers

Solar System Simulator Orbits Not Working 2 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