Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Game is bugged when the Y scale is more than 1

Discussion in 'Physics' started by SonGokuBg, Apr 25, 2020.

  1. SonGokuBg

    SonGokuBg

    Joined:
    Apr 16, 2020
    Posts:
    140
    Hello,
    I have a terrible bug. When the Y scale of a GameObject (I will call it "Obstacle") is more than >= 2, and I start the game my whole game get bugged and the UI says that the player lost the game (which only should happens when the player object hit an Obstacle and the console must say Debug.Log("Obstacle"), but instead the only thing that the console says is that https://imgur.com/a/vH0vIwX ).

    Please help me I can't make any progress like that :(

    P.S. All objects has rigid body.
     
  2. SonGokuBg

    SonGokuBg

    Joined:
    Apr 16, 2020
    Posts:
    140
    Ok, the bug is fixed (a trigger that triggers when the player object falls of the ground, somehow triggers with the ground object ) but how is that connected with the y scale of the obstacles????
    And one more terrible bug: Again when the Y scale of an obstacle is >= 2 the obstacle jump up like it has AddForce and the more the y scale is the more it jumps
     
  3. MuffinMyst

    MuffinMyst

    Joined:
    Nov 17, 2014
    Posts:
    13
    Something to do with the physics of the object, it multiplies by the scale, so a lot of physics gets wonky when the scale is anything other than 1, I've gotten around this by making my scaled object a child of an empty game object (since you are adding force to it, I'd put the rigid body on the parent object, and add force to the parent, so you can scale the child however you want
     
  4. SonGokuBg

    SonGokuBg

    Joined:
    Apr 16, 2020
    Posts:
    140
    I made all my Obstacles a childs to an empty object, but the bug is still alive :( and you miss understood that I am adding force to them.
     
  5. MuffinMyst

    MuffinMyst

    Joined:
    Nov 17, 2014
    Posts:
    13
    Do you have the rigid body on the parent that isn't scaled as well?
     
  6. SonGokuBg

    SonGokuBg

    Joined:
    Apr 16, 2020
    Posts:
    140
    doesn't work