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

Question Instantiated objects don't show up or are in the wrong place

Discussion in 'Scripting' started by GoodAIUser, Jun 22, 2023.

  1. GoodAIUser

    GoodAIUser

    Joined:
    Jul 15, 2020
    Posts:
    11
    My code has a lot of stuff in it but when it comes to these objects it only creates them when they are needed and destroys them when they aren't needed. I have disabled the deleting part for my debugging. I have checked my code for quite a long time and I can't find anything that would cause this problem. I create a line of tiles in the Z axis and these are OK but things are messed up when I make these in the X axis. and travel along it.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,082
    Well that's good because we can't check it unless you post it. ;)
     
    Chubzdoomer and CodeSmile like this.
  4. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    510
    I'm guessing the bug is on line 22
     
    CodeRonnie, CodeSmile and Kurt-Dekker like this.
  5. GoodAIUser

    GoodAIUser

    Joined:
    Jul 15, 2020
    Posts:
    11
    The thing is that if I create an object in one place and not touch it, it should stay where I put it, but this is not the case.
     
  6. GoodAIUser

    GoodAIUser

    Joined:
    Jul 15, 2020
    Posts:
    11
    I am going to get another version of unity and try that.
     
  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    Mate, a different version of Unity isn't going to solve the bugs in your code or the setup of your prefabs.

    You need to debug your code. Hell, even post your code in the first place. Otherwise you'll go exactly nowhere.
     
  8. GoodAIUser

    GoodAIUser

    Joined:
    Jul 15, 2020
    Posts:
    11
    please see this: instantiated objects do not stay where I put them