Search Unity

Question Player character falling very slow

Discussion in 'Physics' started by svprdga, Oct 11, 2021.

  1. svprdga

    svprdga

    Joined:
    Aug 21, 2012
    Posts:
    14
    I am creating a pixel art 2D game in which the player controls a character. The character has a Rigidbody2D of type dynamic. The problem is that fall speed is very slow.

    The world gravity is 9.8.

    The Rigidbody is configured:
    - Mass: 1
    - Linear drag: 0
    - Gravity scale: 1

    The attached script has no effect in terms of the fall speed, because I let the unity physics system take care of it. So when the character is falling, no forces nor movements are applied to the rigid body.

    The size of the attached sprite is configured with 16px per unit. I don't know if this can be related.

    I have seen other threads with similar problems, but I don't like their solutions:

    - I don't want to change the world gravity
    - I don't want to change the gravity scale
    - I am not going to apply an artificial downwards force when the player is in the air

    There is something wrong, and I don't want to apply workarounds, I would like to fix this problem in the right way.

    Does anyone know which could be the cause for this / how can I try to fix this?

    Many thanks.
     
    Last edited: Oct 12, 2021
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,452
    You're probably looking at your Sprite from "far away" i.e. your scale is all wrong. If something moves at 1 m/s at one view scale and then you look at it from twice the view scale then it'll appear to be moving at half the speed. It'll still be moving a 1 m/s though. This should be obvious and it nothing to do with the physics engine. Try it yourself by moving a Sprite via the Transform.

    I'd recommend watching this whole video because it's a great compilation of info but I've linked it at the relevant part here.
     
  3. svprdga

    svprdga

    Joined:
    Aug 21, 2012
    Posts:
    14
    Hi @MelvMay, which is the involved setting related to this issue? The scale of the character is set to 1, if I move it with the transform one unit above, it feels like he's moving one meter up. What settings could I try to tweak to fix this?
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,407
    /slighty_offtopic:
    @MelvMay Can we get those kind of quadratic's into unity as builtin? (since it seems to solve many issues = easier to make 2D games)
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,452
    It was considered a while back but it's just not been a priority and I've hardly seen any requests for it either. It's also something that often only applies to the player and because it's so super simple to add yourself, that further meant it wasn't a priority.

    I did add it as an example here (at least a version of it) in my GitHub physics examples.
    Scene
    Script

    Your camera view. Ever looked at a plane from the ground? It looks like it's moving slowly but obviously it's not. It's because you're far away and it's the same with the camera.
     
    mgear likes this.