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 jrbailey1977 · Jan 03, 2011 at 12:51 AM · charactercontrollersimplemove

3rd person character movement problems

I have an issue with my character jumping intermittently on my map. It perceive it occuring randomly and the odd thing is I am providing no control in the y-axis! Sometimes it will not occur (for an entire gaming session), which is frustrating the debugging process. I am almost ready to model a rickety jetpack on my character and call this a feature (j/k). When it occurs it only appears to happen with the Horizontal key input for forward/backward movement. There does not seem to be an issue with rotating the character.

I am using he following script to move my character around the map. I've been troubleshooting the issue for a bit and have tried a few things (thus all the remaining comments in the code). I initially tried this in the Update() function but saw a few posts recommending that the movement be performed in the FixedUpdate. Additionally, I have set the input settings for Horizontal and Vertical to have an extreme gravity and sensitivity, but still have the issue. I've also tried adjusting the size of the character controller component around my character but this does not help and actually has caused some issues with colliding.

Has anyone encountered this behaviour in their games?

function FixedUpdate () {

var controller : CharacterController = GetComponent(CharacterController); //var playerMoveDirection = Input.GetAxis("Vertical") ; //var playerRotateDirection = Input.GetAxis("Horizontal") ;

// rotate left/right around Y-axis transform.Rotate(0,Input.GetAxis("Horizontal") rotateSpeed Time.deltaTime,0); //transform.Rotate(0,playerRotateDirection * 90,0);

// Move forward/backward var forward = transform.TransformDirection (Vector3.forward); //var curSpeed = speed playerMoveDirection Time.deltaTime; var curSpeed = speed Input.GetAxis("Vertical"); //SimpleMove is in m/s rather than frames/s so no Time.deltaTime req'd controller.SimpleMove(forward curSpeed);

// keep track of where the player is on the grid playerPositionCol = Mathf.Round(transform.position.z); playerPositionRow = Mathf.Round(transform.position.x);

}

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

1 Reply

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

Answer by jrbailey1977 · Jan 09, 2011 at 11:02 PM

This link helped me solve this problem.

http://answers.unity3d.com/questions/4881/character-controller-randomly-flies-up

It wasn't a script issue. My character model that the controller was attached to, had child game objects with colliders. Removing the child object colliders corrected the random jumping of my character.

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

CharacterController.SimpleMove() doesn't exist? 0 Answers

C# Jumping Issue 1 Answer

Character Controller Jittering 0 Answers

Character with controller flies off map. 2 Answers

How to fix a infinity jump? 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