Search Unity

Official NEW! Creator Kit: Beginner Code

Discussion in 'Community Learning & Teaching' started by Woolley_Kat, Aug 22, 2019.

Thread Status:
Not open for further replies.
  1. otreblA_SNAKE_ITA

    otreblA_SNAKE_ITA

    Joined:
    Apr 20, 2015
    Posts:
    1
    Hello there,
    I'm trying to learn programming and I've been following the tutorial (which I found interesting and entertaining) to get some basic knowledge and to try having some practice here.

    I'm now attending the latest "Customize the game" tutorial (https://learn.unity.com/tutorial/cu...c8a4edbc2a0020d1c1b9#5d4c40c4edbc2a0021904e86) but I'm facing a problem: when I create the "Usable Item" I can't do anything with it: neither I can't drag it on the scene, nor I can drag and drop it on any object.

    Why is this happening and how can I solve this issue? I've followed the tutorial step by step, but it's like something is missing there, and I can't test my script by creating the "Usable Item". As far as I can understand by reading some of the tutorial comments, the same issue appears with the other examples (Equipment Item and Weapon).

    Right now I'm trying to use another GameObject (Potion) and overwrite the script, but I find this issue a bit confusing!
     
  2. JoshaEiffel

    JoshaEiffel

    Joined:
    Apr 8, 2020
    Posts:
    4
    Same here. Am completely stuck in limbo like a lot of people right now it seems as CK:Beginning Code recommends you use 2019.2+ .... doesn't work with 2019.3+ (because of outdated protocols) and yet refuses to let you launch it in anything but 2019.3+. So frustrating!
     
  3. noobquestions

    noobquestions

    Joined:
    Apr 8, 2020
    Posts:
    1
    Beginner - would also like to try this out - but cant clear errors -
    Library\packagecache\com.unity.render-piplines.universal@7.1.8\Editor\UniversalRemderPipelineCameraEditor error CS0535

    Running it on windows 10 - wonder if my laptop doesn't have the juice to run this program? or did I download a version for linux or mac or something?
     
  4. tomellwood

    tomellwood

    Joined:
    Dec 13, 2017
    Posts:
    2
    I am having the same issue. First I tried with 2019.3 and I was getting a lot of errors, and no assets correctly loading (everything bright pink), then I realised it was only compatible with 2019.2 so I installed it and removed 2019.3 - now I'm unable to open the project as it says it requires 2019.3.

    Is this being looked into at all? Looks like a really good tutorial to follow along with.
     
    JoshaEiffel likes this.
  5. oscargil2614

    oscargil2614

    Joined:
    Apr 5, 2020
    Posts:
    2
    me too this is innaceptable,dom't believe
     
  6. tomellwood

    tomellwood

    Joined:
    Dec 13, 2017
    Posts:
    2
    I have figured out a solution which works.

    Instead of accessing it from the "Learn" tab in Unity Hub, just start a new blank project using version 2019.2, then inside this project go to the Asset Store and download the Beginner Code kit from within there and import into your project - follow the dialogue to overwrite your existing project, then everything should work as expected.

    I am using 2019.2.21f1 and it works fine.

    *I did also remove the original project from my /AppData/Roaming/... folders before doing this, in case it messed with any of the re-downloading and caching.
     
    JoshaEiffel likes this.
  7. JoshaEiffel

    JoshaEiffel

    Joined:
    Apr 8, 2020
    Posts:
    4
    Nice man, it's sort of worked, is promising. But I'm still having the issue of rendering shaders not found (everything's pink)

     
  8. JoshaEiffel

    JoshaEiffel

    Joined:
    Apr 8, 2020
    Posts:
    4
    Ok - got it!! Thank you, so to get it to work this time I:

    - Deleted everything got the 2019.2.21f1 yahdy yahdy
    - Started a new 3D project
    - Installed Cinemachine from the Package Manager
    - Downloaded and imported BC CK within the projects assets store
    - Said yes to overwriting the current project
    - Allowed updates to project
    - Allowed assets to be reloaded

    Works fine!

     
  9. ebye

    ebye

    Joined:
    Jan 24, 2019
    Posts:
    2
    This is not the best tutorial to follow if it is sound design you are interested in.
     
  10. ebye

    ebye

    Joined:
    Jan 24, 2019
    Posts:
    2
    It is very unfortunate that several of these official projects have errors, it is unprofessional and makes for a bad first impression.

    Anyway, the easiest way to fix the compilation issue, and the pink materials, is to follow these steps:

    - Start Unity, click New to create a new project and select 3D.
    - Go to Window/Package Manager: Select Cinemachine and click Install.
    - Go to Window/Asset Store: Search for Beginner Code and click Import, and Import, then Install/Upgrade.

    This will take quite some time. Then a Import Unity Package window will appear, click Import. This will again take quite some time, but not as bad as the previous step.

    Now you will probably see a lot of pink characters and buildings, but fear not.

    Go to Window/Package Manager, select Universal RP and click Update.
     
    Last edited: Apr 11, 2020
  11. extarlife

    extarlife

    Joined:
    Apr 10, 2018
    Posts:
    2
    I also get the same issue
    I also get the exact same issue on loading the project. I have tried other versions I get errors to fix the compiler.
     
  12. Roninboy

    Roninboy

    Joined:
    Apr 17, 2020
    Posts:
    1
    I'm new to this and have not done any game development prior and when i try to play the game it says that there are compiler errors that need to be fixed. how do I fix them
     
  13. cjl9516

    cjl9516

    Joined:
    Apr 7, 2020
    Posts:
    1
    same here, along with the loading error problem.
    is this project still being updated and maintained?
     
  14. taylc285

    taylc285

    Joined:
    Apr 3, 2020
    Posts:
    1
    i tried to r do this, but it doesn't work when i try to play the exampe scene. the screen is almost completely black. the music plays, and this happens when i click around. its in 2019.3.7f1 upload_2020-4-21_18-40-2.png
     
  15. xacap

    xacap

    Joined:
    Mar 30, 2020
    Posts:
    2
    Thanks for the help. What is your version of Unity?
     
  16. player123753

    player123753

    Joined:
    Apr 13, 2020
    Posts:
    2
    Hi there, which beginner code tutorial is better to follow?
     
  17. joshuavdc

    joshuavdc

    Joined:
    Apr 18, 2020
    Posts:
    2
    In the tenth section, "Customize the health potions", I'm unable to create and open a new script file using the instructions. Instead I get an error saying, "NullReferenceException: Object reference not set to an instance of an object". What does this mean? Am I missing a step or something?
     
    Domzekejon, FoxPan and tropictuco like this.
  18. diablosg838

    diablosg838

    Joined:
    Apr 27, 2020
    Posts:
    1
    Thnx for help been struggling with this i could fix most of the rendering but my moose and barrels would still stay pink,
    your way fixed it for me.

    Current Ver. Unity 2019.3.11f1.
     
  19. vixenou

    vixenou

    Joined:
    Apr 28, 2020
    Posts:
    1
    Code (CSharp):
    1.  
    2.     void Start()
    3.     {//Potion number changes number of potions that spawn on start
    4.         int potionNumber = 5;
    5.         LootAngle myLootAngle = new LootAngle(45);
    6.        
    7.         for (int i = 0; i < potionNumber; i++)
    8.         {
    9.            
    10.             SpawnPotion(myLootAngle.NextAngle());
    11.         }
    12.  
    13.  
    14.  
    15.  
    16.     }
    17.  
    18.     void SpawnPotion(int angle)
    19.     {//Random range radius function so spawning objects look a bit more realistic
    20.  
    21.  
    22.         int radius = Random.Range(1, 3);
    23.  
    24.  
    25.      
    26.        Vector3 direction = Quaternion.Euler(0, angle, 0) * Vector3.right;
    27.        Vector3 spawnPosition = transform.position + direction * radius;
    28.        Instantiate(ObjectToSpawn, spawnPosition, Quaternion.identity);
    29.     }
    I made this for random radius of each object and a bit easier way to add number of spawnable items so you dont have to copy paste a line of code for each additional potion or item. Hope it's usefull.
     
  20. archiviopersonalegeminiano

    archiviopersonalegeminiano

    Joined:
    Apr 29, 2020
    Posts:
    2
    It's a very nice tutorial! Congratulation!
    I have a problem with the creation of "AddHealthEffect" in "Create item effect" window, 'cause, even if I type "AddHelathEffect" and press "Create", it doesnt' work and I can't find "ItemEffects" folder in "Assets/Creator Kit - Beginner Code/Scripts/ItemEffects". Can you help me please?
    I would be very grateful to you :)
     

    Attached Files:

    Last edited: Apr 29, 2020
    collinspencergobin likes this.
  21. xacap

    xacap

    Joined:
    Mar 30, 2020
    Posts:
    2
    I had the same problem. You can make this file yourself in any folder: right-click / create / C# script.

    But pay attention to this:

    using System.Collections;
    using System.Collections.Generic;
    using CreatorKitCode;
    using UnityEngine;

    upload_2020-4-30_12-15-24.png
     
  22. archiviopersonalegeminiano

    archiviopersonalegeminiano

    Joined:
    Apr 29, 2020
    Posts:
    2
    THANK'S A LOT!!!!
     
  23. Gabrosciurti

    Gabrosciurti

    Joined:
    Apr 30, 2020
    Posts:
    1
    Same issue for me. Apparently it's a bug of Unity, also because when I first tested the game the effect was already implemented and you can already find the script in the "Script" folder. I'm following the tutorial and it looked wired once arrived at this point.

    Thanks a lot for the workaround, new here and was stuck on something that I couldn't undesrtand!

    EDIT: Idk if it is intended or not for future updates, but the tutorial is not consistent with what you can find in the editor. Nothing serious, but it can lead to some errors.
    Here, for example, there is an effect attached to the potion (tonic_icon in the image of the tutorial, Icon_potion in the editor) that increases the total character's HP. Again nothing serious, but the errors that we were having come from these differences.
     
    Last edited: May 1, 2020
  24. Biggles007

    Biggles007

    Joined:
    May 4, 2020
    Posts:
    1
    Nice to know I wasn't the only one having a problem with this. :)
    I got thru creating the script (I put it in Assets/Creator Kit -BeginnerCode/Scripts/items/Effects), but it says I should be able to see it in the Inspector. How? All I see is the code when I click on the Inspector. What do I attach it to to see this?
    Any help appreciated.

    I think I found it. I added it to the 'potion' and deleted the call to the existing AddHealthUsageEffect in Scripts directory. Their code looks very different from the

    First Kudos to Unity for doing this. The idea and general quality is good (I can live with 'Purcentage' instead of Percentage) , the QA needs to be improved. Verifying the tutorial matches the application is very important (at least for the beginner stuff) to avoid sending people down rat holes.

    I too am confused about the required version of Unity for this and the FPS project. Right now I am using 2019.3.12f1, which seems to be working so far, but I had problems using the prior version 2019.3.11f1.
    Thanks
     
    Last edited: May 4, 2020
  25. akatenchi

    akatenchi

    Joined:
    May 24, 2018
    Posts:
    1
    Hello.

    For those stuck in:

    Customize your game > Usable Item > 4. Apply the Usage Effect script to the Usable Item > 5. Test your usable item in Play Mode.

    Here is a quick way to test:

    1. Go to Assets > Creator Kit > Prefabs > Tutorial and select a prefab (MoneyLoot or PotionLoot).

    2. From the Inspector, go to Loot script.

    3. Change the Item property using your own Usable Item.

    4. Use the prefab you just updated like in the PotionSpawner or MoneySpawner in the Spawner Sample component's Object To Spawn property.
     
  26. boneey

    boneey

    Joined:
    Sep 13, 2015
    Posts:
    1
    thank u man
     
  27. NotSoCreative

    NotSoCreative

    Joined:
    May 11, 2020
    Posts:
    3
    I'm very new to coding and to unity. I'm currently doing the Creator Kit: Beginner code. Everythings worked fine until now. I'm supposed to write my first own script and to do this I need to create a new script file. They've included a template for this new script file in the Beginner Code tab on unity called "Create item Effect" When I press this I get a window to name the new script file. I name it according to the intructions they give me and press create. Then I get this error message.

    NullReferenceException: Object reference not set to an instance of an object
    NameWindow.OnGUI () (at Assets/Creator Kit - Beginner Code/Scripts/Editor/CreateScriptEditor.cs:178)


    have no idea what it means and no idea how to fix it. I can't progress without fixing it. Any help is much appreciated :)

    Thanks
     
  28. Tudranu

    Tudranu

    Joined:
    May 9, 2020
    Posts:
    1
    I have some bug , all the characters are pink in the sample scene. Please help me . I would love to try out the tutorial.
     
  29. collinspencergobin

    collinspencergobin

    Joined:
    May 22, 2020
    Posts:
    1
    I am having the same problem, did you ever solve it?
     
  30. Bartieofdoom

    Bartieofdoom

    Joined:
    Jul 17, 2017
    Posts:
    1
    At this point I've spent more time "debugging" this tutorial than learning from it. Unless it's updated to fix all these changes it's useless for a beginner like me. I'll have to just settle for reading the tutorial I guess.
     
  31. omaraabed2004

    omaraabed2004

    Joined:
    May 26, 2020
    Posts:
    1
    When I try and create an item effect under beginner code it doesn't fo anything and i don;t know why
     
  32. chamotion

    chamotion

    Joined:
    May 29, 2020
    Posts:
    3
    This is a good test. Now how do we create a new MoneyLoot or PotionLoot (Prefab Asset) so we can spawn more than two usable items?

    Also, is there a similar test for the EquipmentItem? As part of the tutorial, I created an item for the Legs slot using the StatChangeEquipEffect. How do I put this item in the game and/or equip it on the character?

    Update:

    I figured out how to add these items into the game world as loot. I added an item to the scene (like a Potion_Prefab), selected the item from the Hierarchy, selected Add Component in the Inspector, added a Loot (Script), dragged the desired UsableItem into the Loot item field.

    I was able to do the same thing for EquipmentItems and Weapons. I used the icons in Art/Texture/UIElements for the EquipmentItems. I also added a ColliderBox component to small items so they were easier to pick up.

    As far as spawning items, it looks like the breakable barrels have a Loot Spawner (Script) that can spawn multiple items when the barrel is destroyed.
     
    Last edited: May 30, 2020
  33. chamotion

    chamotion

    Joined:
    May 29, 2020
    Posts:
    3
    I had the same problem. I was able to fix this issue by moving win.Display() after the win.OnValidate in CreateScriptEditor.cs. I repeated this for the other Create* menu items since they probably had the same issue.

    Code (CSharp):
    1.     static void CreateItemEffect()
    2.     {
    3.         var win = EditorWindow.GetWindow<NameWindow>();
    4.  
    5.         win.OnValidate = s =>
    6.         {
    7.             ...
    8.         };
    9.  
    10.         win.Display();
    11.     }
    12.  
    I think OnValidate was never getting defined and was causing the NullReferenceException when clicking the Create button.

    Code (CSharp):
    1.         if (GUILayout.Button(validName ? "Create" : "Invalid Name"))
    2.         {
    3.             OnValidate(m_EffectName); // NullReferenceException here
    4.             Close();
    5.         }
    6.  
    Update:

    Even though the above change works, I was still getting a NullReferenceException on the call to ShowModalUtility(). I was able to get rid of that error by replacing

    var win = EditorWindow.GetWindow<NameWindow>();

    with
    var win = ScriptableObject.CreateInstance<NameWindow>();


    The Unity Reference for ShowModalUtility() specifically says EditorWindow.GetWindow is not required for ShowModalUtility().
     
    Last edited: May 30, 2020
  34. Zuiko

    Zuiko

    Joined:
    May 28, 2020
    Posts:
    1
    This project keeps crashing the editor when I try to save the project to a different location following the Tutorial.

    Was there ever a work around to this?

    Edit: Creating a new project and importing from Asset Store instead of opening from Learn tab directly solved this.
     
    Last edited: May 30, 2020
  35. GregoryLane

    GregoryLane

    Joined:
    Mar 11, 2020
    Posts:
    45
    Hello learners!


    Have you signed up for the "Create your first Action-RPG Game with C#" series? Starting June 9th, 2020 at 10 am Pacific Time (17:00 UTC) and continuing on the following two Tuesdays (June 16 and June 23), this live series will explore the basics of C# code for Unity in the context of an action RPG.


    Join us and apply your knowledge of the Unity Editor with a focus on customizing this game with scripts.


    Unity version: 2019.3
    Project Materials: https://bit.ly/ARPGAssets (you can also download through Unity Hub)


    Register now!
    https://create.unity3d.com/register-zoom-webinar?w=92830638118
     
    sanathkukkillaya likes this.
  36. GregoryLane

    GregoryLane

    Joined:
    Mar 11, 2020
    Posts:
    45
    Submit your homework!

    If you participated in our live session on "Creating your first Action RPG game with C#" and completed the assigned homework of creating your own function, please submit your work through our learn portal! Share a screenshot or video of your work for the community to see.

    Submit here today: https://learn.unity.com/tutorial/homework-submissions#
     
  37. Mevzy

    Mevzy

    Joined:
    Jun 3, 2020
    Posts:
    1
    Hello! While going through the project I encountered a NullReferenceException error when I had to do Beginner Code > Create Item Effect, after naming the item AddHealthEffect and clicking create.

    upload_2020-6-10_23-38-51.png

    I wasn't able to find a solution for this online. I didn't make any changes other than what the tutorial guides me through and tried different Unity versions to no avail. In the end, I created the folder and script manually, copied the contents from the tutorial and that's how I was able to finish it.
     
    GregoryLane likes this.
  38. GregoryLane

    GregoryLane

    Joined:
    Mar 11, 2020
    Posts:
    45
    "Create your first Action RPG" refresher: Variables!

    The instruction int angle = 15; declares and assigns a variable.

    A variable is a container that stores a value. You can think of it like a trunk with a name written on it, where you can store information you want to retrieve later. As its name suggests, the information stored in the variable can change (or vary).
    Before you can use a variable, you need to declare it by stating its name and type. You can also assign it an initial value.
    In the image below, a variable (trunk) called gems has been assigned the value 2.

    There are two things you need to identify when declaring (or creating) a variable:
    1. The type of information that will be stored, which tells the computer how much space to save in its memory to store the information. All variables need a type.
    2. This is an int variable. These variables store integers (whole numbers).
    3. The name of the variable, which you will use every time you want the computer to retrieve the variable’s value.
    4. The name of this variable is angle.

    You can learn more about data types here: https://learn.unity.com/tutorial/data-types#
     
  39. GregoryLane

    GregoryLane

    Joined:
    Mar 11, 2020
    Posts:
    45
    Upload your Action-RPG project!

    Using custom potions & weapons to fight those prickly opponents!

    Now it’s your turn!

    Over the past couple of weeks, we learned the fundamentals of working with Unity for designing and customizing our very own Action-RPG.

    What's the only thing that’s missing in turning your software into a full game? Players!

    Show off the personal project and share the fun with the game you created alongside the "Create your first Action-RPG Game with C#" Learn Live series!

    Create a WebGL build and submit your game here: https://learn.unity.com/tutorial/webgl-submissions-arpg

    Last chance to submit your game is June 22nd, 2020. We will be playing selected projects from the community during our final Learn Live session in this series. Come join us and see if your game was featured!


    Looking for more ways to customize your game? Consider modifying your protagonist! Check out all the steps in the video below.

     
  40. Snake111

    Snake111

    Joined:
    Mar 19, 2015
    Posts:
    16
    Great Kit here some ideas for future video:
    -Ability Bar swap weapon
    -Different animation for each weapons
    -Different Idle animation when in combat
    -Pick-up animation
    -Ranged weapon like Pistol-Spear-Bow
    -Crafting system
    -Resources gathering
     
    Last edited: Jun 27, 2020
  41. JMarszalek

    JMarszalek

    Joined:
    Jul 2, 2020
    Posts:
    1
    Hi I am trying to follow this tutorial to learn how to code and create but I have run into a problem when trying to create a new item effect nothing is created so I can't continue to edit the effect of the health potions.

    Would love to be able to continue so does anyone know what to do.

    Thanks
     
  42. mys2stem

    mys2stem

    Joined:
    May 18, 2020
    Posts:
    1
    I am tried to download the game and I am getting an error "import parameters changed during import".
    When I open the game and go to Assets --> Creator Kit --> Scenes -->Example Scene, I actually dont see the Example Scene...I am using Unity Editor 2019.4.2f1
     

    Attached Files:

  43. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    This is one of the best Unity tutorial projects in my opinion. It would be nice if you could add more to this, maybe as a "addon" or a different project which is based on this one with more "advanced" stuff.

    Some ideas would be:
    - Different weapons, like ranged
    - Ability/Skills (similar to Diablo or any other action rpg, different target types (direct, aoe), cooldowns, "ressource" cost (like mana) etc
    - Refactoring of the damage / stat system, instead of "hardcoding" the damage type (enum) and stats (fields in the stats class) it would be nice to make these more dynamic, maybe as scriptable objects, so it will be easier to add/remove custom damage types/stats
    - Adjust the AI to these changes for example allow them to have/use abilities (nothing too fancy maybe just a random selection which ability should be used next by the AI or something like that)

    Obviously all of these things could be added by the developer but it would still be nice to have a "ready" solution by the official Unity Team, Unreal Engine has a whole "Ability System" package with very advanced stuff and even a full demo game, it would be nice if Unity could make something similar and this kit is already a good start, just missing some more "advanced" stuff like mentioned above.

    Adding this to the "Beginner" pack might be too much that's why I would suggest to create a new kit (which is based on this one, so no need to create new models, sound etc) and call it something like "Creator Kit - Advanced Code"

    I have even more ideas, but I think these would be out of the scope for a Creator Kit.
     
    Last edited: Jul 25, 2020
  44. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    542
    Is there any specific reason why you used the weird enum "hack" with the value 666 in EquipmentSlot for weapons instead of adding a real enum value for the weapon type to the enum?

    Also the whole UI seems very small on 1080p setup, the text is way to small, did anyone else notice that and is there a easy fix?
     
  45. Aviyo1

    Aviyo1

    Joined:
    Jul 31, 2020
    Posts:
    1
    Thank you for your help, much appreciated.
     
  46. jlc3dartist

    jlc3dartist

    Joined:
    Apr 28, 2020
    Posts:
    1
    Same problem here... Help, please.
     
  47. grzesiek_dev

    grzesiek_dev

    Joined:
    Dec 3, 2015
    Posts:
    1

    Attached Files:

    Last edited: Aug 14, 2020
  48. joeadams1987

    joeadams1987

    Joined:
    Jun 9, 2020
    Posts:
    1
    This fixed it for me too! How on earth did you work that out?!?
    Thanks mate!
     
  49. classmate4ublog

    classmate4ublog

    Joined:
    Sep 6, 2020
    Posts:
    1
  50. CDR75

    CDR75

    Joined:
    Oct 18, 2020
    Posts:
    2
    Unity hub 2.4.1
    Unity 2020.1.9f1 Personal
    Windows 10 Pro.
    64 Gb RAM 8 cores 16 log. proc.
    Previous use and works on 2019 tutorials but:
    Creatoe Kit : Beginner Code
    try open project...
    Hi i've got nothing in the scene or game view.

    bug.png
     
Thread Status:
Not open for further replies.