Search Unity

GameObject not visible in Game until focused in Scene view

Discussion in 'Scripting' started by kai_226, Nov 17, 2017.

  1. kai_226

    kai_226

    Joined:
    Jul 6, 2017
    Posts:
    53
    Hi guys,

    Short story:
    GameObject not visible in Game view until I "look" at it in Scene view, why?

    Long story:
    I am creating a racing game. Before race start, the camera "flies" to the players car. The player can skip this travel. When the camera is at the players car, a drone [GameObject] should appear that displays a countdown.
    The drone becomes instantiated with a method in code [this method gets called no matter if I skip to the start sequence or not]. The weird thing is, the drone appears in the hierarchy, but not in the Game view most of the times. The countdown [triggered by the drone] never starts. When I look at the drone in Scene view, suddenly it is also visible in the Game view and the countdown gets triggered.
    I already checked if all layers are active and if the camera's culling mask is set correctly. However I think the camera is not the issue as I can see in the hierarchy that the drone becomes instantiated and is at the position where it should be - it's just that I can only see it in my Game view when looking at it in Scene view.

    Any ideas what could cause this weird behaviour?