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 Driskard · Aug 07, 2012 at 05:15 PM · collisioncharacter controllerrotatearound

Character Controller collision disabled after some time

I'm working on a game with third person view. The player character movements and collisions are controlled by a Character Controller. Everything work fine. But after some time, the collision detection on the Character Controller seems to deactivate by itself and the player character fall through the ground are through the walls. This only happends when I use a LootAt function of me own wich does several RotateAround calls on various bones. If the RotateAround calls (and only the RotateAround) are commentented the problem does not appear. I dont see how the collision detection problem can be linked to te RotateAround method. Any help to solve this mystery would be greatly appreciated.

Comment
Add comment · Show 3
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 Seth-Bergman · Aug 07, 2012 at 06:17 PM 0
Share

Basically, using Transform to move things ignores physics/collision, so using RotateAround would allow the object to pass through the floor, and once it's through the surface, it will fall right through.

You would want to find a different method for whatever you are doing in your LookAt function

avatar image Driskard · Aug 20, 2012 at 06:33 AM 0
Share

Please, re-read what I wrote, I think you didn't really understand what I said. Or my enslish is worth than I expected, in this case, I'm sorry.

In no way the Cahracter Controller is linked to the skeleton hierarchy. The Character Controller is only linked to the GameObject by it's root transform. If what you say would be true, we shouldn't be able to animate objects using Character Controller without causing severe problems. What is weird is that the collision works for some time before disabling itself.

avatar image sparkzbarca · Aug 20, 2012 at 07:23 AM 0
Share

I get what your saying they are DIRECTLY connected HOWEVER they are indirectly. They are both children of the playerobject.

The problem is the Collider is a box drawn around the point in space that is the center of the game object it's attached to, but somehow it appears while rotating you are moving the center point which the collider is drawn off of down slightly during rotation.

This is what you could do to try and help debug.

disable gravity.

output the gameobject position before the rotate call output it during each update of the rotate output it at the end

now rotate a whole bunch of times is all sorts of ways.

Somewhere along the line your code is causing the object to move.

Look in your code for any reference to the parent position.

Lets say for example you have a gameobject mesh and it's 2 meters tall the center would be that point 1 meter below the top, the mesh would go from the tip of the players head to the sole of the foot. If you take the foot and you rotate that foot bone to point down, now all you did was rotate the bone right? But wait, that bone moved the player mesh, now by rotating that bone from a 90 degree angle to a 0 degree angle you have made the whole mesh longer. it's now a 2 meter and 1 inch long mesh.

The center of the object is now 1 meter 1/2 inch from the top the collision box is drawn from the center so now the collison box has moved because the center of the object it is drawn off of has moved because of the bone movement.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Help in Javascript destroying Objects using character controllers and conditionals 1 Answer

Moving 'platforms' not colliding with you 1 Answer

Collision update speed 0 Answers

CharacterController Collision causing teleportation? 1 Answer

Character controller, player y changes when pushing on colliders 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