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 jjplay175 · Dec 26, 2014 at 11:45 PM · rigidbodygravitymass

Rigidbody - Slowly flies?

For some reason my player slowly goes up in the air like a baloon at about 0.05 per second... If I put the mass any higher than 1 then it slowly goes down by 0.05 per second... So if the player walks down a hill he just glides... no matter what his mass, it could be 5 or 500 it still falls at an incredibly slow rate?

alt text

Comment
Add comment · Show 3
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 jmgek · Dec 27, 2014 at 02:24 AM 0
Share

Try not to use gravity as a modifier to your game, it is very unpredictable and is more expensive than just using code to move objects.

And there is a force acting on your player so you need to check what is doing that. Also leads to gravity being unpredictable.

avatar image tanoshimi · Dec 27, 2014 at 08:14 AM 0
Share

Hard to say but, from that screenshot, your polar bear looks huge. Having strange scales messes up gravity - he might not be falling slowly, but be falling at normal speed but from far away. Can you place a default Unity cube next to him for reference?

avatar image jjplay175 · Dec 27, 2014 at 05:15 PM 0
Share

I have made him to scale, he is 1 unit, quite small because his just a cub

But just for verification here it is

alt text

sorry about that, the depth of the last picture makes it look massive due to the lack of lighting from under and the fact he was mid air when I took it and I was quite close

2 Replies

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

Answer by furibaito · Dec 27, 2014 at 07:56 AM

You should try to lerp the object velocity to zero and see if that helps. I suggest putting this when the player doesn't input any movement controls

 void Update()
 {
     if (Input.GetAxis ("Horizontal") != 0.0f || Input.GetAxis ("Vertical") != 0.0f)
     {
         // This is just an example of the player is inputting any movement
     }
 
     else
     {
         // The player is not inputting any movement
         rigidbody.velocity = new Vector3.Lerp(rigidbody.velocity, Vector3.zero, Time.deltaTime);
     }
 }

Also, follow what jmgek suggested, try to disable gravity and use scripted movements. For gravity-like movement in the air you could use rigidbody.AddForce downwards (or lerping velocity)

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 Laurent11 · Dec 27, 2014 at 06:06 AM

If you terrain if flat, you can do something like :

 function Update () 
 {
     transform.position.y=groundLevel;
 }

groundLevel is the level of the ground.

Hope that will help you.

Comment
Add comment · Show 1 · 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 jjplay175 · Dec 27, 2014 at 07:37 AM 0
Share

sadly the floor isn't flat :L

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

29 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

Related Questions

Rigidbody's mass 2 Answers

Centre of Gravity 0 Answers

What's the Rigidbody's gravity unit? 1 Answer

Stop Rigidbody From Being Pushed By Another But Still Move With Physics 2 Answers

I have a planetary gravity script; how do I make the object speed up? 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