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 Metron · May 10, 2011 at 03:00 PM · physicscollidercharactercontrollerattached-collider

Box colliders, rigidbody -> Player and picked up cradle

Hi everyone,

in my game the character can pick up a cradle.

To do this, I have attached 2 box colliders to my cradle: One to prevent that the character walks through the cradle and one (slightly bigger) to work as a trigger (to detect if the player stands aside the box).

When the character picks up the cradle, I simply attach it to the player character.

My first approach was to simply attach the cradle to the player and that's it. The problem is that the cradle's box collider (the one preventing the player to walk through the cradle) intersects with the rigidbody of the player character and thus prevents the player character to move.

My second approach was to switch the box collider into a trigger, once the player has picked it up. Now, the player moves as expected, but unfortunately, the box disappears into a wall when the player character stands aside the wall.

My third approach was to disable the collision detection between the rigidbody.collider and the box collider (Physics.IgnoreCollision(rigidbody.collider, boxCollider, true). This seems to work since the player is able to move. But the box still disappears in the wall. I was hoping that the active box collider then would disable the player to walk close enough to the wall for the box to disappear in it.

The cradle does not have any rigidbody attached.

In my last attempt I removed the rigidbody from my player character and I only use the CharacterController to move my character and to handle collisions.

My questions:

  1. Is this "double box collider" approach "the usual way" to handle this "player approaches object he wants to pick up" issue?

  2. How can I prevent my player to do any collisions with the box but the box still prevents the player to approach the wall?

Thanks for your help. I'm really getting nuts on this. Isn't there anyone who had one of his characters carry a box or so ?

Best regards, Metron

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

0 Replies

· Add your reply
  • Sort: 

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

No one has followed this question yet.

Related Questions

CharacterController.Move becomes really slow after I move seperate colliders 1 Answer

Static collider vs Character controller? 1 Answer

How do I detect when two CharacterControllers collide? 0 Answers

Collider attached to a character controller doesn't work 3 Answers

w Key - Character Jumps 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