• 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

Character Controller OnControllerColliderHit never called. 0 Answers

OnCollisionEnter not working 1 Answer

Can't seem to get movement to work 0 Answers

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

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges