Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Prefab Spawn Point issues

Discussion in 'Getting Started' started by DerBears, Apr 10, 2020.

  1. DerBears

    DerBears

    Joined:
    Jun 3, 2018
    Posts:
    4
    Hey all, I'm trying to fix my spawn points to the prefab, for a coin to spawn, then through animation disappear. I'm making a mario style question mark box. For my Brick prefabs, the particle effects are working properly so far, but for some reason all the coins spawn at the first box, despite edits in the Inspector or changing the root motion option on the animation. Any tips? Code below.

    Code (CSharp):
    1. public Transform crate;
    2.     public GameObject loot;
    3.    
    4.    
    5.     // Use this for initialization
    6.     void Start () {
    7.        
    8.     }
    9.    
    10.     // Update is called once per frame
    11.    
    12.         void OnTriggerEnter(Collider other)
    13.         {
    14.             if (other.gameObject.CompareTag("Player"))
    15.             {
    16.             //instantiate break action before spawning loot
    17.             Instantiate(loot,  transform.position, transform.rotation);
    18.             this.gameObject.SetActive (false);
    19.  
    20.        
    21.                
    22.         }
     
  2. DerBears

    DerBears

    Joined:
    Jun 3, 2018
    Posts:
    4
    i also tried crate.transform.position, crate.transform.rotation but also to no avail -__-
     
  3. DerBears

    DerBears

    Joined:
    Jun 3, 2018
    Posts:
    4
    Skip several seconds, i have issues with the recording software sometimes and was playing with it off screen