Search Unity

Objects randomly spawning at origin on scene startup

Discussion in 'Physics' started by ADNCG, Sep 21, 2015.

  1. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    994
    Once in a while, say once every 6-7 times, I start a scene in the editor, although it seems pretty random, one of my prefab likes to randomly pop at (0, 0, 0) and ignore physics.

    This happens even when the game object is completely stripped of all its components, beside a sprite renderer and a rigidbody2D. This happens with or without colliders, they don't seem to have an impact on the issue. There are no scripts interacting with the object.

    I've tried toying with the rigidbody2d parameters to find out what's causing it. It seems the problem only occurs when the rb is set to kinematic or when freeze position x or y is ticked.

    As for the physics 2d options, everything is still set to default, except "raycast hit triggers" and "raycast start in colliders" that aren't checked anymore.

    Time options are modified in the following way:
    Fixed timestep : 0.01666667
    Max allowed timestep : 0.01666667

    This happens in multiple scenes using the prefab.

    Honestly I don't even know where to look, I don't understand the issue at all. Help!
     
  2. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
  3. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    994
    HiddenMonk likes this.