Search Unity

Other BoxCollider2D works differently in Unity Preview and in Device Simulator

Discussion in 'Physics' started by blurbladegrafika, Dec 17, 2023.

  1. blurbladegrafika

    blurbladegrafika

    Joined:
    Dec 17, 2023
    Posts:
    1
    Hello,


    It is how looks like my BoxCollider2D:
    upload_2023-12-17_23-8-29.png

    And in Unity Game preview it works correctly:
    My character stops when I reach left edge
    upload_2023-12-17_23-9-6.png

    But when I run this app using Device Simulator or as apk on device, then this collision work like below:
    upload_2023-12-17_23-10-39.png



    It is this box on the edge:
    upload_2023-12-17_23-11-37.png

    it is pig:
    upload_2023-12-17_23-11-54.png
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,450
    Physics knows nothing about the Simulator and there's no platform specific code in it so your problem isn't physics.

    That simply looks like rendering aspect. Verify that position is being rendered by rendering something there.