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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Instantiated Prefab Not Showing

Discussion in '2D' started by heytheremogwai, May 8, 2020.

  1. heytheremogwai

    heytheremogwai

    Joined:
    Mar 22, 2018
    Posts:
    36
    Hi,

    I'm instantiating a prefab arrow at a location like this...
    Code (CSharp):
    1.     public GameObject arrow = null;
    Code (CSharp):
    1.         Instantiate(arrow, target, Quaternion.identity);
    ..and I set the prefab arrow into the inspector for the script. The arrow prefab is set to the correct layers, z-position (0), and they're marked visible...(Default), and it shows the clones are appearing and when I log the location they are correct as well... However they are not showing up anywhere in the game/scene view. Not sure what I'm doing wrong here...? I've also attached a rigidbody2d as well...
     
  2. nabrown

    nabrown

    Joined:
    Jun 27, 2019
    Posts:
    27
    We will need to see the prefab in the inspector view. Do you have a sprite attached?