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
2
Question by Adeny · Mar 14, 2011 at 11:38 PM · charactercontrollerkinematicrigidbodies

Making a Character Controller

So because the default CharacterController is useless (see: http://www.youtube.com/watch?v=gA8Ns_KMxv0) because it uses a capsule collider and there's no way to change that (WHY?!? Sigh.) I figured I have to go ahead and make my own Character Controller from scratch. If there's an easier way please do tell!

(From youtube page description:) As a CharacterController moves to the edge of a square platform, the curve of the capsule causes the character to move down causing the model to appear to sink into the platform.

So, I figure I need a kinematic Rigidbody attached to my character (it shouldn't be affected by physics, only collide with solid objects (so that it doesn't fall through ground etc). Does that mean I have to build a collision system from scratch, since afaik, kinematic rigidbodies do not collide?

Comment
Add comment · Show 1
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 Peter G · Mar 14, 2011 at 11:45 PM 0
Share

You can add your own sliding effect so it falls off and doesn't hang on the sides of objects.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Statement · Mar 14, 2011 at 11:46 PM

Does that mean I have to build a collision system from scratch, since afaik, kinematic rigidbodies do not collide?

Well you certainly should take a look into the volume collision tests unity offers. Ironicly they are Physics.SphereCast and Physics.CapsuleCast but you might be able to do something custom with Physics.RayCast. These methods can ease your movement code so your character doesn't walk inside colliders. Maybe you could just do a raycast from the left and right sides of your character and stop gravity from being applied if it hits something? Sounds like an easy fix for the otherwise working controller. You should also know that Physics.SphereCast has a potential bug.

I haven't tried this but could you perhaps parent a box collider to your characters "feet"?

What you could try to do is otherwise make the capsule collider a bit bigger, or just accept it intersects a bit. It is quite common in triple a games that models intersect with surroundings. You can do a bit of research on your favourite games yourself. Maybe you're too concerned about it?

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 Statement · Mar 14, 2011 at 11:55 PM 0
Share

For sympahty, I also wish the character controller was a bit flexible. I had to tackle this problem for a project :) http://answers.unity3d.com/questions/35781/can-i-use-character-controller-with-animal-characters-such-as-a-crocodile

avatar image Adeny · Mar 15, 2011 at 12:50 AM 0
Share

A parented box collider does not work for movement/etc, but at least it'll give me more accurate checks for picking up coins/etc.

Here's another example using a cube character: http://img217.imageshack.us/img217/7453/clipped.jpg

That's about 25% of the characters corner sunk into the ground.

avatar image Adeny · Mar 15, 2011 at 12:56 AM 0
Share

Can't seem to find how to edit my comment here, just wanted to clarify that I meant 25% of my characters height, which could become problematic. Say there's a ball of fire that's now flying above him, creating a safe zone (if jumping back down would otherwise be dangerous).

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

No one has followed this question yet.

Related Questions

Guidelines for using rigidbody, collider, CharacterControllerScript, etc? 3 Answers

Gravity Scale Zero or Kinematic? 1 Answer

CPMA Movement with Rigidbody, replacing the Character Controller 0 Answers

Mass setting Rigid bodies to Is kinematic 2 Answers

Character Controller and Kinematic Collision 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