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 Sriram · Nov 23, 2010 at 02:05 PM · collisionobjectcharactercontrollermovingthird-person

Collision of a moving object with a standard 3rd person controller

Hello there,

I had an issue while working on a game and if you could point me on to the right direction it would be great!

I am trying to check collision between a horizontal cylinder which is rotating on the y-axis, with my 3rd person character(standard controller provided with Unity) controller that comes along with unity 3. Both my GameObjects have been assigned a rigid body component but somehow as soon as the cylinder comes close to the character it passes through it rather than colliding with it. Are there any particular settings i need to change to get this working? Your help on this would be highly appreciated.

Thanks in advance!

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

1 Reply

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

Answer by skovacs1 · Nov 23, 2010 at 04:15 PM

There are 2 simple explanations. I'm not sure which is the case here, but I would guess the first:

  1. One or both of your rigidbodies are sleeping. You would need to do something to wake them up either explicitly or implicitly. Perhaps you should consider having your cylinder be kinematic?
  2. Collision between these objects or layers has been disabled. Layer collisions can be checked/changed in the Project's physics settings or by calling certain function. Likewise, collision between individual objects can also be disabled through code. The IgnoreRaycast layer is automatically ignored by physics.
Comment
Add comment · Show 3 · 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 Sriram · Nov 24, 2010 at 05:28 AM 0
Share

Hello and thanks for the reply

1.The kinematic flag has been checked for the cylinder in this case and still no results.The funny thing is it is colliding with my player at random intervals.Like it would collide on the first attempt and then maybe the third(random times) and then it would stop.Is this because of some technique used to check collision for the 3rd person controller? I have tried to replace the character with a cube and it works just fine. 2. I checked the physics setting and all layers have been checked so im sure that it hasnt been disabled in anyway.

Thanks in advance

avatar image skovacs1 · Nov 24, 2010 at 03:28 PM 0
Share

You never mentioned that it collided sometimes - that changes the question a lot. The 3rd Person controller is just a script and has no bearing on collisions in and of itself. Do you have any other objects with colliders (maybe child objects of your character or something) that might be getting in the way? Also, for concave meshes, collisions and raycasts are somewhat unpredictable when using a mesh collider. Your best bet is to use a primitive (or at least convex) collider (like a capsule) or properly setup CharacterController Component (different from 3rd person character controller script).

avatar image Sriram · Dec 02, 2010 at 01:59 PM 0
Share

Thanks a lot.I have made some progress now I removed the character controller and attached a standard box collider to my player and have attached a rigid body component to it.I wrote a simple animation script to contol the character animation.

This seems to work, as in the character is nowcolliding with the moving obstacle.But im not too impressed with the results.$$anonymous$$aybe i need to alter some values till i get it to work properly.

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

Ignore collision between character controller and a rigid body object 1 Answer

Fast moving object passing through other objects. 6 Answers

Physics AddForce reduced when 3 objects are colliding 1 Answer

colliding with 2 objects at a time 1 Answer

Detect collision with specified object 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