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 TheGoliath · Apr 27, 2012 at 01:53 AM · physicscharactergravityscalefloat

Player flies up into the air when walking

I have a character I'm using for the player, with a character controller and movement script attached. I also have an imported terrain model that the player is supposed to walk around on. But as soon as I press the up arrow key to move forward, my character gets launched into the air up to a certain height, and stays there. I've never had this problem before, and I've used these exact same scripts for the player in a different game and they worked fine. I even used the same character. I never had this problejm. The only thing that's different is the imported terrain model. I tried using rigidbodies, I made sure I was using gravity in both the rigidbodies AND the project physics, I tried a different movement script and I made sure there were no other colliders on my character except for the character controller. Nothing helps. Also, when my character shoots up into the air, she starts to fall back down but stops, and just floats there. If I keep moving, she starts to fall at certain points but goes back up to the same height. And everywhere I go, wherever the terrain slopes upward, my character does too, meaning she always stays at the same height above the ground. Even when I walk into the wall of a bulding, she flies up even further and stays above the roof at the same height she was from the ground. It's almost like there's an invisible layer covering the entire terrain, and everytime I move I just pop up to the top of it. Can someone please help me figure out what's causing this? Is there something I'm not checking?

Comment
Add comment · Show 5
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 hijinxbassist · Apr 27, 2012 at 05:29 AM 0
Share

@TheGoliath Is there a mesh collider on the imported terrain model. This sounds like what would happen if the mesh collider is set to convex.

avatar image TheRedGuy90 hijinxbassist · Mar 23, 2016 at 04:06 PM 0
Share

What difference does it make if the mesh is convex? What does that do

avatar image GC1983 · Apr 27, 2012 at 06:10 AM 0
Share

a script would help.

avatar image TheGoliath · Apr 29, 2012 at 08:40 PM 0
Share

No, I haven't applied any kind of collider, except for just checking "Generate Colliders" in the inspector. But when I don't do that, my character just falls through the floor. And honestly, what script would I post? The movement script I'm using has never given me any problems before, and I already tried a completely different one. The same exact thing happened.

avatar image GC1983 · Apr 29, 2012 at 08:59 PM 0
Share

I was asking to see your movement script. Have you just tried using the character controller movement call? Or is that what youre using? It calls GetAxis which then you manipulate the speed upon the framerates. All you need is that, make sure you have your CC attached to your char and the terrain has a mesh collider to make the CC respond. Thats it. I literrally just did this to a project i made and all works great. If you already knew this, excuse me for preaching to the choir. =)

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Seth-Bergman · Apr 30, 2012 at 04:16 AM

is your character controller properly sized to your character? Try hitting play, then pause, and see if it stays properly lined up with the character. Otherwise, it may be a problem with the export from 3ds or whatever you're using, in which case make sure the character is at the zero position when you export, just a guess.. If you think the terrain might be the issue, replace it with a big box or something and see if that fixes it, in which case it may indeed be the mesh collider.

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 TheGoliath · Apr 30, 2012 at 04:09 PM

I finally figured it out. My terrain was TINY when I imported it, so I sized my character down to match it. It turns out that was the problem. I made everything a lot bigger and now my character stays on the ground. I still appreciate you guys trying to help though, thank you.

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 WeBeSmartRocks · Apr 30, 2012 at 05:52 PM 0
Share

Do you think the problem came due to when shrinking the character you also moved its reference to the terrain?

avatar image TheGoliath · May 01, 2012 at 08:06 PM 0
Share

Honestly I have no idea. I'm still a bit new to this.

avatar image
0

Answer by Lokiare · Nov 08, 2014 at 02:45 AM

I ran into this problem and it has to do with the difference between your navigation height when you bake and the height of your Nav Mesh Agent on your model. You can fix it by offsetting the Nav Mesh Agent on your model, I don't know if this affects path finding or whatever.

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

10 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

Related Questions

character gravity problem 1 Answer

Rotate Gravity 90 degrees for one object. 1 Answer

Change Gravity? Physics scaling for large objects to behave like normal ones... 0 Answers

Realistic gravity and physics on a playable character. How? 1 Answer

How to scale down physics engine 2 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