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 pickle chips · Jul 08, 2013 at 10:25 PM · collisioncollidercharactercontrollercapsulecapsule collider

Getting Character controller to fit model?

I have this model, which uses a character controller, but I can't get the capsule to fit it nicely. I need it to cover it entirely so it collides properly when it moves, but I can't rotate the collider to be along the z-axis like a normal capsule collider, and I can't increase the radius too much because then it just makes the collider way to large on the sides! Does anyone have a solution? thanks

alt text

colliderissue.png (37.3 kB)
Comment
Add comment · Show 4
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 Julian-Glenn · Jul 08, 2013 at 11:20 PM 0
Share

Can't you just attach an empty gameobject with a spherical collider to the mesh and attach it to the dragon mesh and then move it into position around the head? Or add a mesh collider to the entire mesh, which will be more memory intensive, but would match the mesh.

avatar image Benproductions1 · Jul 09, 2013 at 12:34 AM 0
Share

@Julian Glenn, the problem with using a combination of colliders to move using a CharacterController, is that fisrtly, all other colliders will collide with the CharacterController and secondly, they will not affect movement.

@pickle chips
The only way to avoid this, is to use either the physics system. Or write a movement system yourself.
As a quick fix you could scale the CharacterController to encompass the entire model, but from your question, that is not what you want.
Also you can't rotate the character controller, it's impossible

avatar image pickle chips · Jul 09, 2013 at 01:20 AM 0
Share

grrr... $$anonymous$$aybe I'll just have to deal with it being super wide...

avatar image AlucardJay · Jul 09, 2013 at 07:49 AM 0
Share

I think there is a way if you use the system found in the Angry Bots project.

It uses the $$anonymous$$ovement$$anonymous$$otor class, and the Free$$anonymous$$ovement$$anonymous$$otor class is attached to the gameObject.

A reference is stored to the Free$$anonymous$$ovement$$anonymous$$otor script :

 public var motor : $$anonymous$$ovement$$anonymous$$otor;

then feed it normalized Vector3s for movementDirection and facingDirection :

 motor.movementDirection = Input.GetAxis( "LeftStick Horizontal" ) * screen$$anonymous$$ovementRight + Input.GetAxis( "LeftStick Vertical" ) * screen$$anonymous$$ovementForward; // screen$$anonymous$$ovement vars are Vector3s
 motor.facingDirection = Input.GetAxis( "RightStick Horizontal" ) * screen$$anonymous$$ovementRight + Input.GetAxis( "RightStick Vertical" ) * screen$$anonymous$$ovementForward;

So you shouldn't have to modify your code that much. Just change to feeding normalized vectors and controlling the speed on the Free$$anonymous$$ovement$$anonymous$$otor. Then you hopefully should be able to use compound colliders and a rigidbody for your character.

0 Replies

· Add your reply
  • Sort: 

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

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

Related Questions

OnCollisionEnter Push Object Problem 0 Answers

OnTriggerEnter() and OnCollisionEnter(), OnControllerColliderHit() not working with character controller 2 Answers

Can't seem to get movement to work 0 Answers

Making Colliders/Triggers or Rigidbodies move a Character Controller 5 Answers

Character Controller giving false collisions 0 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