Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question I can't figure out how to make enemies respawn

Discussion in 'Editor & General Support' started by DrPTF, May 24, 2020.

  1. DrPTF

    DrPTF

    Joined:
    May 14, 2020
    Posts:
    11
    Hi guys,

    I'm a newbie playing with the Creator Kit: Beginner Code, and I tried a whole day trying to write some code that can make an enemy respawn after killing it. I failed miserably. Attaching the player respawn code to enemies didn't work either. Please help.
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @DrPTF,

    My recommendation for you is to check and follow the 2 Unity's official "3D Game Kit" tutorials:
    - 3D Game Kit Walkthrough; and
    - 3D Game Kit Reference Guide.

    As you will see, both tutorials have a respawning system, so you can check and learn about it.


    Happy learning!
     
  3. DrPTF

    DrPTF

    Joined:
    May 14, 2020
    Posts:
    11
    @DiegoDePalacio Unity doesn't let me have it easy, new problems arose in the 3D Game Kit:

    1. I get this error: Some MeshRenderers cannot contribute to global illumination, because their HideFlags are set to DontSaveInEditor, HideAndDontSave or DontSaveInBuild.

    2. Probably related, but the rock cliff assets are all see-through, only their top surface is shown and I can run into their models. The environment painters should show a thumbnail of the assets used, but the thumbnails aren't there.

    Following your suggestion on another one of my post, I need to save project in a new location then? The default location seems to be in the temporary files.

    Edit: Also, how do I move the project out of the temporary folder? I tried to move the other Beginner Code Kit into another drive and people said that I just need to move Assets and Library folders, but when I open from new location, many file links are broken and the kit become unusable.

    Edit2: "I can run into their models"
     
    Last edited: May 27, 2020
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @DrPTF,

    Make sure that you're using the same Unity version that the project was created for.

    On the other hand, usually, the main folders that contain all the project, that you should move, are `Assets`, `ProjectSettings`, and `Packages`.

    The `Library` and `Temp` folders are generated by Unity, so you can delete them safely.


    Good luck with it!
     
  5. DrPTF

    DrPTF

    Joined:
    May 14, 2020
    Posts:
    11
    @DiegoDePalacio The tutorial is indeed made for Unity 2019.1... so I need to install that too to continue the tutorial? I really wish that the versions would not break beginner tutorials this easily...
     
  6. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    you can use few tricks
    Code (CSharp):
    1. void OnDie()
    2. {
    3. transform.position = new Vector 3(0,0,0);
    4. }
     
  7. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    @DrPTF,

    Each Unity version has a lot of changes for good. Unfortunately, these changes have some chance to not work properly on older versions.

    Normally, if the jump between versions is not too high, the things that need to be fixed should be very little.

    With a little bit more experience, I'm sure that you'll be able to solve such issues by yourself, but as a beginner, you should try to avoid as many problems as you can in order to focus on learning the core.

    Using the same version of Unity, than the one that was used to create the tutorial, is not mandatory but can make the things for you a little bit easier.

    If you really want to avoid the installation of such version of Unity, what you can do also, is to ask your specific questions about the 3D Game Kit tutorial, in the official forum: https://forum.unity.com/threads/3d-game-kit-official-thread.530684/

    You'll have better chances to get support to those specific questions.


    Good luck with it!