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 Kaze_Senshi · Jan 01, 2012 at 03:16 PM · collidercharactercontroller2d-platformerboxcollider

OnColliderStay does not work

Hello guys, I am having a problem with colliders, I am trying to do a conveyor belt, I have the player with a characterController and one box ( the future conveyor belt ) with one box collider. I put this function in the box:

 var speed : float = 3.0;                           
                                      
     function OnCollisionStay(collisionInfo : Collision) 
     {
         Debug.Log("a");
         /*var platformerController : PlatformerController = collisionInfo.gameObject.GetComponent( "PlatformerController" );
         if( platformerController )
         {
             platformerController.setExternSpeed( Vector3( speed, 0, 0 ) );
         }*/
     }


But it did not work when the character is over the box. Even the Log did not appeared. Can someone give me some light? I tried to put kinemact rigid body in both objects but it didn't work too. Thank you.

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 Kaze_Senshi · Jan 03, 2012 at 03:10 PM 0
Share

Well, I tried to search more in google and I do not find nothing that could help me. I created other cube with the function "OnCollisionEnter", but it did not work too. Only the "OnControllerColliderHit" inside the player works. Any idea guys?

1 Reply

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

Answer by aldonaletto · Jan 03, 2012 at 03:47 PM

Yes, collisions between CharacterControllers and rigidbodies are weird: OnControllerColliderHit always works fine, but OnCollision events not. When the rigidbody hits the character, OnCollisionEnter events are sent to both; when the character hits the rigidbody, however, this event is almost never sent.
If possible, use OnControllerColliderHit - the alternative would be to have a trigger volume a little larger than the actual collider and use OnTrigger events instead.

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 Kaze_Senshi · Jan 04, 2012 at 01:47 AM 0
Share

That idea worked well, and also solved the problem of the "direction" of the collision. Thank you again aldo =)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Character Controller collision box too large? 1 Answer

Box collider with character controller? 0 Answers

how to disable the character controller and box collider for after hitting the character controller 1 Answer

Charcter won't go through Box Collider!! Need Help asap! 1 Answer

Move sprite depending on its collider position 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