Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 matyicsapo · Apr 15, 2010 at 02:13 PM · raycastcharactercontrollerslopealign

CharacterController running downhills

Hi,

I have a moving CharacterController and I'm trying to make it so that when ground "disappears" from beneath it's feet because of a down slope then don't fly off but rather stay on the ground. I don't want to rotate it just align it's Y with the Y of this slope's surface.

I'm using raycasting to determine if there's ground beneath it till a certain height and it works fine. I try to align by simply altering my "deltaMovement" which gets passed into Move at the end of update.

The problem is that it walks down with a limited speed. Why is this limited? I don't know :/. Looked through the whole code twice I swear. Tried adding a PhysicMaterial with zero values to make take out friction from any possible calcualtion but it seems like that it's useless as there aren't any rigidbodies here, though I'm not quite sure if that's needed or not.

The problem seems to be that no matter what controller.isGrounded doesn't consistently stay true. But that's why I try to align by altering deltaMovement rather then direct translation and has no effect.

As you can see I'm quite confused. Also kinda sad as it seemed pretty easy and I was very happy when all plans and calculations on paper were correct.

Thank you for reading :)

Comment
Add comment · Show 2
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 spinaljack · Apr 15, 2010 at 03:15 PM 1
Share

Can't you just increase the gravity to make the character stick to the slope better?

avatar image matyicsapo · Apr 15, 2010 at 06:45 PM 0
Share

actually that does solve the problem so I though that simply substracting more from "delta$$anonymous$$ovement.y" would solve it too but it doesn't so there might be a bug in my code(will update(topic too))

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by matyicsapo · Apr 15, 2010 at 07:50 PM

spinaljack's comment helped a lot

figured out that the problem was with my code

i could find the right value to align teh charactercontroller to the ground i just had to apply it outside stuff

sg. like this' http://www.unifycommunity.com/wiki/index.php?title=FPSWalkerEnhanced anti-bump stuff

anyway thanks for reading :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

No one has followed this question yet.

Related Questions

How, from scratch, can I detect the angle of the ground underfoot a character not controlled by a character controller. 1 Answer

How to detect ground slope angles in 3d? 1 Answer

How can I guarantee a CharacterController never leaves the ground? 2 Answers

Linecast & Raycast won't hit the outer surface of a CharacterController 1 Answer

Quaternions- how to leave out Y rotations... 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