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 sandriga · Jan 19, 2013 at 09:14 AM · charactercharactercontrollergravityground

gravity or others. i don't get it. what i suppose to coding it

i have a problem on the interface of this game. example, i have a box. i have done to give a character control for it. so in the map i have a hill. and when my character go up to the hill. the character didn't touch the ground well.

difficult to explain it ok this is the pict. alt text

left pict is my character looking. and the right pict is my imagination character looking. what i have to learn about. it is about gravity? or other? somebody please give me your advices

untitled.png (9.4 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 Imankit · Jan 19, 2013 at 09:42 AM 0
Share

You have to use rigidbody ins$$anonymous$$d of a characterController

avatar image sandriga · Jan 19, 2013 at 11:17 AM 0
Share

rigibody,,, ok oh yeah can you please give me a script that is having a similarity with this case?

avatar image sdgd · Jan 19, 2013 at 12:04 PM 0
Share

the left picture is correct if you don't want to move your character with physics witch is most recommended

while you'll found lots of problems in the right picture making your sphere in the end or capsule

 you won't be able to go up hills

 if capsule you if you go up hill you'll figure out that your head is going to knock back on the floor
avatar image sandriga · Jan 19, 2013 at 12:14 PM 0
Share

i want to make a character from the "box" shape so i don't think about make it to be a capsule. oh yeah about "correct if you don't want to move your character with physics" what kind of physics i must take to the character? can you give me a sample script please,,, :) i need your help so much about it because i am a new for it

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by whydoidoit · Jan 19, 2013 at 12:32 PM

If you want to orient your character to stand on the surface of the item it hits you can do that using a ray cast:

    RaycastHit hit;
    if(Physics.Raycast(transform.position, transform.down, out hit, 2)) //Change 2 to fit just more than the height of your character
    {
          transform.rotation = Quaternion.FromToRotation(transform.up, hit.normal) 
                    * transform.rotation;
    }
Comment
Add comment · Show 2 · 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 sandriga · Jan 20, 2013 at 04:18 AM 0
Share

wow thank you :) i will try it ok i say again, thank you very much :)

avatar image sandriga · Jan 20, 2013 at 04:46 AM 0
Share

oh ya can i ask you something,,, can you explain to me what is ray cast?

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

11 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

Related Questions

haw to fix the roteid ground for the chareter ? 1 Answer

Character controller model colliding. How to disable it? 1 Answer

Character Controller/Motor Ground Delta 0 Answers

character gravity problem 1 Answer

Gravity not working 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