Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

slow falling character

Discussion in '2D' started by lostdefender, Jun 7, 2016.

  1. lostdefender

    lostdefender

    Joined:
    Mar 29, 2014
    Posts:
    7
    My character falls really slowly even though it has a rigidbody2D on it. I can't seem to figure it out. Any help would be nice thanks
     
  2. Yourname

    Yourname

    Joined:
    May 21, 2013
    Posts:
    15
    Yeah I have the same issue, not sure how to fix that.
     
  3. capnjake

    capnjake

    Joined:
    Nov 12, 2013
    Posts:
    53
    Have you tried increasing the mass of your rigidbody? Or increasing gravity from 9.8f?
     
    SnowMAviD, Landerk and lostdefender like this.
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,542
    Probably the view-scale. 1 world unit is 1 meter. The physics system is designed around realistic sizes and forces. You can scale up gravity and forces and reduce masses but this can make the simulation unstable.

    When you say it moves slowly, how many m/s is it moving? That's the best way to consider it.
     
    lostdefender likes this.
  5. capnjake

    capnjake

    Joined:
    Nov 12, 2013
    Posts:
    53
    Ah, I hadn't thought of that potentially being an issue. Depends entirely on sprite's pixel per unit setting or the scale of the object in question. An 8x8 sprite would be relatively very small on the default 100 pixels per unit setting.
     
  6. lostdefender

    lostdefender

    Joined:
    Mar 29, 2014
    Posts:
    7
    I'm sorry I am still too new for alot of this. is there a way to show you what's happening? Thank you for the help you have provided so far!
     
  7. capnjake

    capnjake

    Joined:
    Nov 12, 2013
    Posts:
    53
    Take a screenshot of the inspector when you have the gameObject selected and another when you have the raw imported image of the sprite selected then host them to imgur or something?

    What is the size of the sprite image you imported?
     
  8. lostdefender

    lostdefender

    Joined:
    Mar 29, 2014
    Posts:
    7
    Screenshot (1).png
     

    Attached Files:

  9. lostdefender

    lostdefender

    Joined:
    Mar 29, 2014
    Posts:
    7
    Also this character isnt mine i am just using it for practicing purposes.
     
  10. capnjake

    capnjake

    Joined:
    Nov 12, 2013
    Posts:
    53
    All of that looks fine. You shouldn't need to push the gravity scale up to 35 on your rigidbody. Any idea the pixels per unit set on your knight PNG/JPEG file? You can check this by clicking the raw image in your Assets folder and seeing what it says in the inspector. http://docs.unity3d.com/Manual/class-TextureImporter.html (Scroll down to the Sprite to see what I'm talking about).

    And then can you tell me the resolution of that image (i.e. 128x128) or whatever.

    edit: Also, what version of Unity are you using out of curiosity?
     
    lostdefender likes this.
  11. Chaveex

    Chaveex

    Joined:
    Jun 8, 2016
    Posts:
    4
    Hello,

    I am also a newbie with Unity. I try to make a game with a scrolling background and a "Player" which can jump, so I followed a tutorial on internet. But my Player was also falling very slowly.. I tried to change gravity and set it to 9.8, then to 98, so it was falling faster YES ! but when I wanted to jump, the Player was jumping as high as a grain of sand... So I did cheat and add a huge force addForce(0, 200000,0, Force); , it makes me think I'm going wrong...

    I am facing the same problem, using Unity 5.3, so I'm also interested, hope something can help you capnjake with what I said. I believe the image I used is kind of small.
     
  12. lostdefender

    lostdefender

    Joined:
    Mar 29, 2014
    Posts:
    7
    So i check and the sprite says its 425X512 then the other change to 587X707. I push the gravity scale that high because thats the only way to actually make the character jump. Also if i am correct its a NPOT. I'm using Unity 5.3.4f1. Thanks for the help so far.
     
  13. capnjake

    capnjake

    Joined:
    Nov 12, 2013
    Posts:
    53
    I think it may have something to do with the NPOT textures. See this post: http://forum.unity3d.com/threads/npot-textures.54954/

    Is there anyway you can convert them to JPEG or PNG images? I think the scaling is getting fudged because of Unity deals with NPOT textures. I'm not really an expert in the subject and it'd be easier if I could see your project file. If you'd like I can take a look at that.
     
  14. unity_72NNT-e0FQsyKw

    unity_72NNT-e0FQsyKw

    Joined:
    Feb 22, 2021
    Posts:
    13
    Anyone ever get anything on this? I got the same slow moving sprite. png, 16x16. gravity and forces need to be too high for it to work but it's not realistic etc.
     
  15. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,542
    See my post above. Sprite texture sizes are nothing to do with it and it should be obvious that if you take off the SpriteRenderer, it'll move the same because it's the Rigidbody2D moving. Sprites are visual, it's the physics that produces the dynamics (movement). It's because you've got the wrong scale. Looking at cars moving from an airplane would mean they look like they're hardly moving. Adjust your view scale. Sizes are in meters so it's easy to produce

    A good video talking about this can be found here (look at 4:10)
     
    unity_72NNT-e0FQsyKw likes this.
  16. MegaLowVoltage

    MegaLowVoltage

    Joined:
    Feb 16, 2016
    Posts:
    1
    Hey everyone. Just wanted to provide a potential solution to whomever may spend significant time researching the slowfall issue on their own 2d player objects.

    In the player controller script, I didn't alter the y-velocity of the rigidbody2d explicitly, but I was calculating dX with horizontalSpeed * horizontalInput * Time.fixedDeltaTime, and then called rb2d.MovePosition(position.x + dX). Removing this method of horizontal movement allowed my player character to fall with the same gravity as the imported unity 2d square shape, resolving my hours and hours of slowfall.

    I had gone over scale issues, rigidbody2d composition, dynamics vs kinematics, gravity scaling, drag, about everything you might find when scouring google about the issue.

    All along, it was because I was using explicit calls to position changes on the x-axis.

    Maybe this post will save someone else some research time.


    "A man is what he thinks about all day long.” – Ralph Waldo Emerson

    “May you have a song in your heart, a smile on your lips, and nothing but joy at your fingertips!” – Irish Blessing
     
  17. ColledUniversity

    ColledUniversity

    Joined:
    Dec 29, 2022
    Posts:
    1
    Even though I change the scale, small, medium, big, 0.48x. Its the same speed and still very slow
     
  18. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,930
    Please do not necro post. Start your own thread... it's FREE.

    When you post, remember we cannot read your mind.

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/