Search Unity

Game mode doesn't have all built assets from Edit mode

Discussion in 'Editor & General Support' started by ChromazoneX, May 30, 2019.

  1. ChromazoneX

    ChromazoneX

    Joined:
    Mar 13, 2019
    Posts:
    12
    When I build/edit assets in the scene everything runs smoothly. The problem is when I switch to game mode to play it where there are some holes and my character will fall through them. An example would be: I have a room attached to a hallway and in edit mode it is there. I can add tables, plants and whatnot, but in play mode that room is gone- with the exception of maybe one "floating" lamp (it's only floating cause the table it was on is not displayed in play mode). I have tried walking into said room hoping that it just wasn't visible, but I fall forever because the assets are gone. I can re-position the camera so in the hallway when i switch to play mode i can walk down to that same room and i can look into that room and everything is absent. Only a few places of the scene are like this; most of the game is fine otherwise.

    Any assistance with this is appreciated, thank you!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You'll need to figure out why they are "gone." Did the GameObjects get destroyed? Did they move? Do they have rigidbodies with gravity enabled and just fall as soon as you hit play? Are they getting disabled by some script? Can't say from here.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I don't suppose any of these game objects are marked as Static in the inspector? Things work a bit differently in a build versus in the editor when it comes to static objects. Your post makes it sound like maybe you're adding/repositioning objects at runtime? If so, those objects can't be static, or you won't be able to move them. Long shot, but worth mentioning.
     
  4. ChromazoneX

    ChromazoneX

    Joined:
    Mar 13, 2019
    Posts:
    12
    it was a script thanks for your inputs.