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 donutkeith · Nov 21, 2012 at 11:37 PM · colliderrotate

How do I rotate a Collider?

I am making a third person game and I want to make the character go prone(lay down). How can I change the character controller collider to rotate so that it lies along the ground instead of up and down. Or if that is not possible or very complex how can I go about shutting off one collider and turning on another? Which way is better use one collider and rotate it so it lies on the ground or use two colliders one for stand/crouch and another for prone. I can not seem to find any ways to rotate the collider without rotating my mesh.

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

3 Replies

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

Answer by aldonaletto · Nov 22, 2012 at 01:11 AM

The CharacterController is always upright: its vertical direction is always world Y, even if you rotate the transform.
If you want a soldier or similar character, a possible solution is to change the CharacterController height - and perhaps its radius when the character goes prone (a height < 2 * radius is ignored and assumed to be twice the radius). For instance: h=1.8 r=0.4 for stand, h=1.4 r=0.4 for crouch, h=0.4 r=0.2 for prone. The problem here, obviously, is the horizontal dimension, but in many cases only the height matters (to be hit by enemy shots). If you want to make the soldier vulnerable to hits when in prone position, add a box collider (menu Component/Physics/Box Collider - select Add instead of Replace when the Replace existing component dialog appears). Adjust the box collider center and dimensions so that it never touches the CharacterController capsule, or the character will "think" it's colliding with its own colliders.

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 SomeGuy22 · Nov 22, 2012 at 12:41 AM

You can't rotate the character controller but you can shrink it to be the approximate size you want. Take a look here, same idea: http://answers.unity3d.com/questions/21811/how-to-make-the-fps-character-crouch.html

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 donutkeith · Nov 22, 2012 at 01:22 AM 0
Share

I know I can shrink the controller and that does help with crouch, which I do have
working well enough, but I need to be able to detect collisions with the front of the body and the legs. The capsule collider doesn't stretch into an oval. For example the collider stands up and down along the y axis and I need it to go left and right along the x or z axis. So when I shrink the capsule down to the height it needs to be in the y direction it eventually becomes a sphere and it will not stretch beyond a perfect sphere. But I need the capsule to encompass more of the body then just the middle section. I hope this helps clear up what I need.

avatar image
0

Answer by giantkilleroverunity3d · Jan 10, 2017 at 08:22 AM

Post friggin toasty. Add a rigidbody and then manipulate. The addition of a collider needs to know the spatial orientation. At least this is why the inteface works the way it does. Without the RB the rotational manipulation does not enable a rotation of the vector handles.

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

12 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 avatar image

Related Questions

Images Rotation 1 Answer

Rotate the wheel collider when car flip 1 Answer

Click on collider to rotate camera 1 Answer

Mirroring sprite around arbitrary axis causes collision issues 0 Answers

Compound Collider Moving Parts? 4 Answers


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