Search Unity

Question Scaling Positions and Sizes down equally

Discussion in 'Editor & General Support' started by qiveal, May 19, 2022.

  1. qiveal

    qiveal

    Joined:
    Jan 31, 2022
    Posts:
    320
    So I have a problem in my game where sometimes objects pass through each other, I think this is happening because the overall scale of my game is too big, making me have to put objects at a high velocity. I have positions in my game that are very precise and need to move when being scaled down. If I selected everything I could do this with the scale tool, but that would be very inaccurate, for things in my game that move I need to be able to say something like "Ok, I cut everything in half the force was 1 now it is 0.5", how can I do everything proportionally like that?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    Have you set your Rigidbodies to use continuous (or continuous dynamic) collision? It's more expensive but often will solve pass-through problems.

    Also, are you properly moving stuff that needs to collide?

    With Physics (or Physics2D), never manipulate the Transform directly. If you manipulate the Transform directly, you are bypassing the physics system and you can reasonably expect glitching and missed collisions and other physics mayhem.

    Always use the .MovePosition() and .MoveRotation() methods on the Rigidbody (or Rigidbody2D) instance in order to move or rotate things. Doing this keeps the physics system informed about what is going on.

    https://forum.unity.com/threads/col...-unity-physic-rigidbody.1216875/#post-7763061

    https://forum.unity.com/threads/oncollisionenter2d-not-being-called.1266563/#post-8044121

    With a wheel collider, use the motor or brake torque to effect motion.
     
  3. qiveal

    qiveal

    Joined:
    Jan 31, 2022
    Posts:
    320
    Yes the rigidbody is set to that. The only time I directly edit the transform is when none of the physics need to be used at that time.
     
  4. qiveal

    qiveal

    Joined:
    Jan 31, 2022
    Posts:
    320
    For example when a object is disabled and I'm resetting it.