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 JPBenge · Oct 17, 2021 at 12:28 AM · charactercontrollerjumpingcharacter controllercharacter movement

Character Controller Upward Movement Along Concave Surface

Hi,

I'm noticing some strange / inconsistent behaviour with Character Controller that I can't understand and I'm wondering if anyone knows how it's working internally, or why this might be happening.

The very basic setup I have to demonstrate the issue is like this: A capsule with a Character Controller attached to it A wall leaning slightly towards the capsule A script that moves the capsule every frame

Setup

You'll notice that the wall is leaning towards the positive X axis. This is just to simplify the issue even further.

If my MoveTest script looks like this

 public class MoveTest : MonoBehaviour
 {
 
     private CharacterController controller;
     // Start is called before the first frame update
     void Start()
     {
         controller = GetComponent<CharacterController>();
     }
 
     // Update is called once per frame
     void Update()
     {
         controller.Move(new Vector3(0, 1f, 0) * Time.deltaTime);
     }
 }

When the capsule hits the wall as it travels upwards, it is adjusted towards positive X so that it tracks along the wall as it moves upward.

However, if I change the script to this:

 public class MoveTest : MonoBehaviour
 {
 
     private CharacterController controller;
     // Start is called before the first frame update
     void Start()
     {
         controller = GetComponent<CharacterController>();
     }
 
     // Update is called once per frame
     void Update()
     {
         controller.Move(new Vector3(0, 1f, 1f) * Time.deltaTime);
     }
 }

the behaviour is different. This time when the capsule hits the wall, it only moves in the Z direction and stops moving upward. Its upward movement is blocked rather than the Character Controller pushing it towards Positive X and allowing it to continue to move upward as before. This seems odd, because the movement I gave it in Z is perpendicular to the wall, so theoretically it shouldn't affect what happens in Y and X.

It's almost as if Character Controller is checking both X and Z for any velocity and not allowing any modification of position if either of those are not 0, which in turn prevents upward movement.

This issue means I'm having trouble when my character jumps and hits a slightly angled-in wall. Ideally, I would want them to track along the wall and continue moving upward rather than hitting their head and falling immediately.

Any explanation for this, or maybe a workaround would be appreciated.

Thanks

issue-setup.png (267.0 kB)
Comment
Add comment
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

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.

Follow this Question

Answers Answers and Comments

147 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 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 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 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 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 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 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 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 avatar image avatar image avatar image

Related Questions

Shift BHOP in Character Controller 0 Answers

Player acts weirdly when I release movement input 0 Answers

I can't do that my character jumps while running 0 Answers

Cannot jump while running downhill,Character can't jump while moving down 0 Answers

CharecterController.Move() ignores parents movement 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