Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
2
Question by e-bonneville · May 01, 2010 at 06:10 PM · collidercharactercontroller

Why won't my box collider collide?

Hi, I've got a box collider attached to a character controller. When I move the character controller, the box collider won't collide when it comes into contact with, say, a wall. Because it's acting as my gun, the player can simply stick it through the wall and fire... not acceptable. So, is there a way to do this, and if so, how?

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

4 Replies

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

Answer by Cyclops · May 01, 2010 at 10:34 PM

I thought I remembered another Question that answered that, and just found it - ironically, it's your post :) Seagulls flying through models, in which you say a script always overrides physics.

Since the Character Controller uses a script, FPSWalker, I would guess that overrides the box Collider.

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 Eric5h5 · May 01, 2010 at 11:00 PM 1
Share

"A script always overrides physics" isn't really accurate, considering you can add physics forces naturally in a script, or use movement methods that react to colliders. Setting an object directly using transform.position or transform.Translate will override physics though. However that's not what's going on here...CharacterController.$$anonymous$$ove() does in fact react to colliders.

avatar image e-bonneville · May 01, 2010 at 11:49 PM 0
Share

Thanks, @Cyclops.

avatar image Cyclops · May 02, 2010 at 01:21 AM 0
Share

@Havoc, don't thank me, you should read @Eric5h5's answer - I'm sure he's more right than I am :)

avatar image
0

Answer by Narven · May 01, 2010 at 08:17 PM

You need to create a collider for the gun.

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 e-bonneville · May 01, 2010 at 08:42 PM 0
Share

Yeah, I did that. And yet it persists in penetrating my walls.

avatar image
0

Answer by Eric5h5 · May 01, 2010 at 10:56 PM

A character controller uses a capsule collider only. If you want to use other colliders, you'll have to use something other than a character 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
avatar image
0

Answer by GamersFrenzy · Jul 15, 2014 at 04:10 AM

Not the script, add Rigidbody to both the Player and the Trigger Collider and check kinematic on both I also set Collision Detection to continuous That should help out.

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

1 Person is following this question.

avatar image

Related Questions

Character Controller Object Randomly Falls Through Colliders 3 Answers

3D combat in Unity 2017 3 Answers

When jump my character controller model it goes out of collider 0 Answers

FPS controller prefab and grenade script 2 Answers

Difference between character controller and Rigidbody + Collider 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