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
1
Question by Sting_Auer · May 19, 2012 at 01:34 AM · rotateturn

How do I keep a character from rotating?

I want to disallow my character from tipping over, but still be able to rotate left and right. How would I go about doing this?

Comment
Add comment · Show 8
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 shadowriffe · May 19, 2012 at 02:40 AM 0
Share

What are you using for the physics of your character? A capsule collider? A character controller?

avatar image Sting_Auer · May 19, 2012 at 02:57 AM 0
Share

The model is a rigidbody and it has a box collider. Would a character controller be prefferable?

avatar image shadowriffe · May 19, 2012 at 02:59 AM 0
Share

It somewhat depends on what you want to do with the game. Character controllers collide with things, but do not use regular physics. Thus they are more fit to be used for characters. Pushing things around etc has to be done with another script however.

avatar image Sting_Auer · May 19, 2012 at 03:01 AM 0
Share

Well, I really just need a character that can move around without tipping over. Pushing isn't needed.

When I put a character control on my character, it just falls through the ground. What am I doing wrong?

avatar image Kevin_C · May 19, 2012 at 03:13 AM 0
Share

does it have a collider component?

if you really wanted to you could replace it Euler angles with(0,y,0), and that way it will only ever rotate about Y, and your question title is ambiguous

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer Wiki

Answer by BJ · May 19, 2012 at 04:40 AM

I'm creating a 2D game and utilised:

  • RigidBody -> Constraints -> Freeze Position Z

  • RigidBody -> Constraints -> Freeze Rotation X Y Z

The freeze rotation prevents the sprite plane slipping into the z axis. I'm not sure if this is helpful in your case.

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
0

Answer by reptilebeats · May 19, 2012 at 03:31 AM

silly question but has your ground got a collider on it, best way without seeing your settings would to create an empty just with the character controller, this will at least rule out a few things, also have you got a rigidbody im pretty sure they dont use a rigidbody as like shadow says it doesnt use regualer physics so putting a rigidbody on it kinda defeats the purpose

check out http://unity3d.com/support/documentation/Components/class-CharacterController.html

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 Sting_Auer · May 19, 2012 at 01:14 PM

Thanks very much Brendan! I can't believe I missed that little cropdown menu D:

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotating to -forward goes upside down 1 Answer

Make player move in local direction he is turned. 1 Answer

How do I make my player face the way he walks? 2 Answers

Camera rotation around player while following. 6 Answers

Rotate model, turn around only, no bend? 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