title: Game object not visible in game view
body: <p>in my game i added a simple game object to follow my player , but the problem is it is not showing the follower when i click play , i'm new to unity , can any one help me  . ill be attaching the script that i tried and output screenshot that i'm getting now.</p>
  
  <p>(the follower is visible in scene window , disappears when i click play button)</p>
  
  <p><a href="https://i.stack.imgur.com/I53rU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I53rU.png" alt="enter image description here"></a></p>
  
  <p>script :</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class FollowPlayer : MonoBehaviour {
  
  
  public GameObject playerobj ;
  public float smoothtime = 0.3f ;
  Vector2 velocity = Vector2.zero;
  
  public int yoffset;
  
  void Start () {
  
  }
  
  void Update () {
  
      Vector2 targetPosition = playerobj.transform.TransformPoint(new 
      Vector3(0,yoffset));
      if(targetPosition.y &lt; transform.position.y)
      return;
      targetPosition = new Vector3(0 , targetPosition.y);
      transform.position = Vector2.SmoothDamp(transform.position,targetPosition,ref velocity,smoothtime);
      transform.position = new Vector3(transform.position.x ,transform.position.y ,-10) ;
  
  }
  }
  </code></pre>
  
  <p>thanks in advance guys !</p>