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
-1
Question by LPGaming · Jan 16, 2013 at 02:27 PM · c#physicsbugglitch

Physics not working with Character Controller

So, I'm using a character controller component on my sphere to roam around, yet I can't seem to do collisions correctly. using the RigidBody and Character Controller they don't allow for OnCollisionEnter it seems, but when I add a Collider to it... It starts to breakdance, No clue why, I guess the collider and rigidbody are bouncing off of eachother or something, is their any way to stop this so I can have collisions work the way I want them to? I know there's something like OnCharacterControllerCollision or something, but if you use that and run into something, it registers it as thousands of collisions per second, where was "OnCollisionEnter" Registers as one, which is what I need.

Comment
Add comment · Show 6
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 danilonishimura · Jan 16, 2013 at 03:19 PM 0
Share

Hi LPGa$$anonymous$$g, as we stated on the other question you made, your system is completely glitched out. But, if you're runing this code on other machine, you also need to tell us about the version because a lot of things changed from Unity3 to Unity3.5 and some of them had to do with Physics. If you're on Unity4, that's weird, because it works on my computer. Check if your GameObject's collider isn't with the "trigger" box checked.

avatar image LPGaming · Jan 16, 2013 at 03:44 PM 0
Share

I'm on unity 4, I've been running unity 4 for awhile, I just stated on the other thread that the editor is glitching out. All of my scripts were writtin inside of unity 4, they were workign before. Not sure if you where the one to downvote, but there was absolutely no reason for it. The question is completely unrelated.

avatar image danilonishimura · Jan 16, 2013 at 04:06 PM 0
Share

I didn't downvote and I also don't see any reason for it. So anyway, your scripts were working before the editor started glitching out and then some of them stopped working?

avatar image LPGaming · Jan 16, 2013 at 04:28 PM 0
Share

No, It's been glitching since I installed unity, I reinstalled unity again a few moments ago and it's still doing it. $$anonymous$$y script just stopped working randomly, all of the scripts work, but the collision parts won't do anything.

avatar image sparkzbarca · Jan 16, 2013 at 05:31 PM 1
Share

you need to post code.

You also need to decide whether to use a rigidbody or a character controller. They are both implementations of the physics system.

As to the idea of thousands of times per second that is by definition impossible basically without changing stuff you almost certainly didnt change.

Physics occurs during fixedupate which can be changed in frequency but by default runs at 60FPS. So at most your colliding 60 times per second.

That assumes your continually trying to push through an object in which case yea it has no choice but to constantly run physics simulations to react appropriately.

$$anonymous$$Y GUESS

character controller is a collider by definition. It has one built into it, a capsule shape. Placing another collider onto that with a rigidbody means these two objects are probably directly in collision with eachother AND they can't escape. One object is probably attempting to move EVERY SO SLIGHTLY to stop being in the other objects space. But they are tied together so moving one collider moves the other, they infinitely fight eachother and move slightly and who the hell knows what happens but i imagine it looks alot like breakdancing.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Loius · Jan 16, 2013 at 07:53 PM

You could attach a duplicate capsule (with kinematic rigidbody) to your controller, on a layer that doesn't collide with the controller itself, and use that object to check for collisions instead of the controller.

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.

Follow this Question

Answers Answers and Comments

11 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

Related Questions

Distribute terrain in zones 3 Answers

How can i fix weird physics bug/glitch ? 1 Answer

Objects not becoming active with script 1 Answer

Wheel Collider RPM value is flickering between valid value and undefined. 0 Answers

Syntax issue- only assignment, call, increment, decrement, and new object expressions can be used as statement 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