title: I want my object to fall when the player is near it
body: <p>I want my objects to fall when the player got to that scene . My game have a long map and I want them not to fall when I start the game .There is any code for player detection in the view? for the objects to fall?</p>
  
  <pre class="lang-csharp prettyprint-override"><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class FallDown : MonoBehaviour
  {
         public float fallSpeed = 8.0f;
  
      //Variables for starting position and length until reset
      private Vector3 _startingPos;
      public float FallDistance = 5f;
  
      void Start()
      {
          transform.Translate(Vector3.down * fallSpeed * Time.deltaTime, Space.World);
          // Save starting position
          _startingPos = transform.position;
      }
  
      void Update()
      {
          transform.Translate(Vector3.down * fallSpeed * Time.deltaTime, Space.World);
  
          // If the object has fallen longer than 
          // Starting height + FallDistance from its start position
          if (transform.position.y &gt; _startingPos.y + FallDistance)
          {
              transform.position = _startingPos;
          }
      }
  }
  </code></pre>