Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Prefab Losing Target Transform

Discussion in 'Prefabs' started by REM_Studios, Sep 22, 2019.

  1. REM_Studios

    REM_Studios

    Joined:
    Sep 14, 2018
    Posts:
    18
    I'm making a game where police cars chase the player. I have empty GameObjects around the world instantiating my police cars using a "Police Car" prefab when the player is near it. This same car prefab is also destroyed at a certain distance away. The problem is, my prefab does not keep the "Target Transform" in the "Car AI Control" or the "Car Controller" scripts. This means when the car instantiates, it doesn't follow the player. This seems to happen to all of the prefabs I create. I am using the Unity "AI Sky Car" with my own car body on it. If somebody could help it would be greatly appreciated.