Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity NEW! Creator Kit: Beginner Code

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

  1. Woolley_Kat

    Woolley_Kat

    Unity Technologies

    Joined:
    Jan 18, 2018
    Posts:
    15
    MooseCloseUp2_AssetStore_SocialMedia (1).jpg

    Welcome to the fourth Creator Kit - Beginner Code.

    Creator Kits are short step-by-step tutorials which enable beginners to gain a good understanding of Unity.
    This Beginner Code kit introduces you to the fundamentals of C#; from understanding how to read a script to creating your own variables and adjusting the gameplay in this top-down action RPG.

    Explore the town of Rancho Rodadora and do some feisty gardening as the rakish sheriff Moose, defeat Cactus Nails and battle Cactus Bossy in the example game that accompanies this beginner code project.

    Let us know what you think of the project, any problems, issues or delightful insights. Help us make our content even better for you. Check it out on the learn site Here and Asset Store Here

    Thank you :)

     
    Last edited by a moderator: Aug 23, 2019
  2. YouWinNest

    YouWinNest

    Joined:
    Jul 7, 2018
    Posts:
    1
    Okay..Lets Learn..On standard way
     
  3. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    29
    Can't find it in my projects tab, my friends have the same problem. I can find the previous ones tho
     
  4. Tacoor-Gafruf

    Tacoor-Gafruf

    Joined:
    Dec 28, 2016
    Posts:
    1
    got the same problem i think its the unity version i have installed. going to install reccommend version

    edit:- nope i dont see it in the list still
     
    Last edited: Aug 22, 2019
  5. HostileTech

    HostileTech

    Joined:
    Feb 17, 2019
    Posts:
    3
    Hi there, for some reason I am also unable to find the project in my unity hub, is there an alternative manner to download the project?
     
  6. Aurore

    Aurore

    Head of Learn Content Production Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,104
    Hi, We've updated the links on the forum post as well as added the project to the Learn Tab on the Hub
     
  7. mario83

    mario83

    Joined:
    Nov 10, 2013
    Posts:
    1
    I think there is a step missing. After we implement the myLootAngle constructor, there is no explanation as to how to use this in the Spawn function to actually set the new angles. Either it's missing or I am blind.
    I managed to figure it out, but it was pretty frustrating, because I did not know, if I had made a mistake.
     
  8. HostileTech

    HostileTech

    Joined:
    Feb 17, 2019
    Posts:
    3
    Hi Aurore, thanks for the update. I am able to see the project under the projects tab but it has no option for me to create an instance of that project, when I click open in unity from the website it shows me the project but no download for the files, just view tutorials.
     
  9. Aurore

    Aurore

    Head of Learn Content Production Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,104

    Hi,

    This is fixed now, you can also download the assets from the link on the tutorial page

    upload_2019-8-23_17-6-35.png

    Also from the Asset Store here https://assetstore.unity.com/packages/templates/tutorials/creator-kit-beginner-code-151986
     
  10. HostileTech

    HostileTech

    Joined:
    Feb 17, 2019
    Posts:
    3
    Hi Aurore,

    I am able to see it now. Though it took a little longer than expected, as in I read the post and then went back and forth and option was still missing, if somehow possible its still a glitch or my unity hub did not sync correctly, what I did before it showed me the button, I created another project and clicked through asset store to download and then when I opened unity hub again, under projects when I clicked on it, it showed me the option to download project. (In case anyone else in similar boat as me at the time.)

    Thank you for your help, much appreciated.
    Regards
     
  11. rkaetano

    rkaetano

    Joined:
    Aug 27, 2012
    Posts:
    59
    The project looks great, but I'm facing some problems with the terrain.

    When I open the scene, depending of the angle I'm facing, the terrain appears to be rotated.
    And in game, I cannot see the terrain.

    Any ideas of what could it be ?

    upload_2019-8-24_7-1-45.png

    upload_2019-8-24_7-2-42.png

    upload_2019-8-24_7-3-50.png

    upload_2019-8-24_7-4-56.png
     
  12. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    156
    Your Scene view is showing the Game User Interface (GameObject “GameUI” in Hierarchy).

    In Hierarchy, select GameObject “MikeMoose” from Character dropdown, move your cursor over the Scene view and press the F key.
     
  13. rkaetano

    rkaetano

    Joined:
    Aug 27, 2012
    Posts:
    59
    The problem is with the terrain, not the UI.
     
  14. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    199
    Why not using an enum on Attributes ? (strength, dexterity and so on)
     
    Last edited: Aug 25, 2019
  15. stobak

    stobak

    Joined:
    Dec 9, 2016
    Posts:
    2
  16. ProToeType

    ProToeType

    Joined:
    Nov 6, 2018
    Posts:
    2
    Just finished the tutorial! Very cool stuff, C# is one matryoshka nesting doll of a concept very cool!
    Thank You Unity!
     
  17. UnityRos

    UnityRos

    Unity Technologies

    Joined:
    Apr 1, 2019
    Posts:
    7
    You're absolutely right -- I'm sorry for the frustration. The tutorial has been updated with the missing step.


    Thanks for flagging this -- it's been corrected. :)
     
  18. AndyTruman

    AndyTruman

    Joined:
    Aug 19, 2019
    Posts:
    13
    That's great - Thank you for sharing! :)
     
  19. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,311
    wouldnt a video tutorial more efficient instead of a written one?
     
    futz8855 and AndyTruman like this.
  20. AndyTruman

    AndyTruman

    Joined:
    Aug 19, 2019
    Posts:
    13
    You are right Devision4 - I do agree with you!
     
  21. simon99hall

    simon99hall

    Joined:
    Jul 21, 2019
    Posts:
    1
    Download gives errors and doesnt run
    upload_2019-8-31_15-38-9.png
     
  22. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    122
    The screenshots only show warnings, those shouldn't stop the project from working (but thanks for reporting them, we should try to remove those in the next release).

    If you press play in the state the editor is in that screenshot, nothing will happen as the scene is empty. The 1st tutorial will guide you to open the right scene to test the game (part 7 here : https://learn.unity.com/tutorial/ge...025dedbc2a0020e85be2#5d4c222fedbc2a00219044fa )
     
    simon99hall likes this.
  23. spiraloid

    spiraloid

    Joined:
    Aug 11, 2015
    Posts:
    7
    Gamepad support would be awesome with this.
     
  24. BjarteNor

    BjarteNor

    Joined:
    Nov 30, 2014
    Posts:
    2
    I'm trying to find out how "AttackEvent" and "FootstepEvent" in AnimationControllerDispatcher. I tried adding my own enemy, but it does not get these triggered... I have been checking it up and down to match the game object or if it's in the animation controller, simply can't find references for "Footstep" anywere. Please help :)
     
  25. BjarteNor

    BjarteNor

    Joined:
    Nov 30, 2014
    Posts:
    2
    Oh whoops, I found it by using Total Commander search, it's baked into the animation :)

    Example from: CactusBossy_Walk

    upload_2019-9-12_22-52-5.png
     
  26. scarabelt

    scarabelt

    Joined:
    Sep 17, 2019
    Posts:
    1
    I really liked it, but i want to enlarge the map. i tried to remove some grass and paint the sand on it but i can't walk there?
    How can i walk on that terrain?
     
  27. Durghan

    Durghan

    Joined:
    May 3, 2018
    Posts:
    13
    Hey there. So I'm totally new to this and trying to get through this kit. I've encountered an issue I'm having a heck of a time resolving.

    In part 10, the create parameters for the constructor portion, step 4 says to go change

    LootAngle myLootAngle = new LootAngle();

    to

    LootAngle myLootAngle = new LootAngle(15);

    Then immediately on part 11 it seems to indicate changing that to

    LootAngle spawnAngle = new LootAngle(45);

    Is that what it's saying to, or am I supposed to be adding this in addition to the existing one?

    Here is what my start function looks like based on the steps in the tutorial.


    void Start();
    LootAngle myLootAngle = new LootAngle(15);

    LootAngle spawnAngle = new LootAngle(45);

    //every call will advance the angle!
    potionSpawn(spawnAngle.NextAngle());
    potionSpawn(spawnAngle.NextAngle());
    potionSpawn(spawnAngle.NextAngle());
    potionSpawn(spawnAngle.NextAngle());

    It feels wrong and has several errors I don't quite understand. Any insight would be great.

    Personally, at the end of this part it would be nice to see the full script as it should look so I know where I made my mistakes.

    Thanks!
     
    Last edited: Sep 21, 2019
  28. Durghan

    Durghan

    Joined:
    May 3, 2018
    Posts:
    13
    Discovered my problem! The wording of one of the steps seemed to have me put the following outside of the SpawnerSample class.


    void SpawnPotion(int angle)
    {
    int radius = 5;

    Vector3 direction = Quaternion.Euler(0, angle, 0) * Vector3.right;
    Vector3 spawnPosition = transform.position + direction * radius;
    Instantiate(ObjectToSpawn, spawnPosition, Quaternion.identity);
    }

    Move it move it into the class below the Start function and everything was better!

    Thanks!
     
  29. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    104
    I'm working on expanding this using resources from Synty Studios' Western and Western Frontier Packs, and animations from Explosive's RPG Character Animation Pack.

    As someone noted above, the Attack animation that is built in to the Tutorial uses an Animation Event to indicate when a hit has occurred, and this calls CharacterControl.AttackFrame().AttackFrame does several things, but probably the most important is that it sets the player's stateback to Default. So without this, the CharacterControl.CheckAttack() function thinks we're still attacking, so the player can never attack after the first one!

    To deal with this, we can add an Animation Event called AttackEvent to our animations, BUTthe RPG Pack actually comes to our rescue because EVERY attack has a Hit() Animation Event built in ANDtimed correctly!

    So I just created a Hit() function here, and then copied the body of the AttackEvent() function!

    The Run animation that the Tutorial uses *also* relies on an Animation Event to kick up dust as you run along, but AGAIN the RPG Animation pack saves our bacon, with the FootL() and FootR() functions.This is actually arguably better, since you can (if you want) explicitly determine which foot is hitting the ground and exactly when! I didn't do anything weird with the different feet here. I just copiedand pasted the body of FootstepEvent() into FootR() and FootL() functions, and it now correctly kicks up dust for my cowgirl!

    NEAT!

    So now a question: the SeethroughBlue shader has some really funky effects when applied to the Synty character models, most likely because there are some occluded triangles within the mesh, which causes the shader to kick in even when the character is standing out in the open. Is there any way to deal with that, or am I just more or less stuck with disabling it? It's such a NICE effect, but it looks terrible if the model isn't optimized.

    I've also gotten a pistol to work nicely, but so far have not found a way to quickly switch weapons in game. I'm controlling my animations using a WeaponID parameter, which I suppose I should bake into the Weapon stats Scriptable Object, and add to a script, but I haven't worked that out yet (at present I switch it manually in the Editor).

    This is a REALLY good kit, with lots of great systems built in. I switched out the Mike Moose model for a cowgirl from the Western pack, and was pleasantly surprised when she appeared in my Inventory screen without me having to figure out how that was done!

    Oh, if you're going to switch out the main character for one of your own, you'll need to do a few things:

    - Create an Animator Controller, since Mike Moose's animations are specific to him. You can (and probably should!) copy his Animator Controller, and just swap out the animations, though.
    - Copy every component from the Character object in the Example Scene onto an empty game object (mine's called Character_Player_Cowgirl)
    - Make your character model the child of that empty game object
    - Remember to assign an Animation Controller Dispatcher to your character model!
    - Create an empty game object that's a child of Character_Player_Cowgirl (or whatever you call yours) and rename it to CameraTarget
    - Update GameplayVCAM (a Cinemachine Virtual Camera) to Follow and Lookat the new Camera Target object
    - Update Managers->SFX Manager to make the Listener Target your new Camera Target
    - Update Managers->UIRoot->GameUI to set the Character_Player_Cowgirl to be the new Player Character

    There may be more, but so far everything is humming along swimmingly.

    This thing is a lot of fun!! :)
     
  30. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    122
    Just calling AttackEvent() from inside your new Hit function should work the same and will allow you to have a single place (the AttackEvent function) to modify if you want to do modification to what happen on attack. Same for footstep event.

    The seethrough need to be rendered before the character. Normally that's the shader would do 2 rendering pass, the see through first, but shader graph don't allow yet to do multi pass, so we have to rely on the renderer drawing meshes multiple time if it have more material than mesh. But that mean we need to order them properly.

    If you look at the see through material, you will see that it's rendering queue is set to 2098 (Geometry+98), that is set through the shader, and if you look at MikeMoose material you will see it's queue is 2099 (Geometry+99) so that it's draw AFTER the see through one. Since the see through does not write into depth, the character rendering will "overwrite" any blue it render on top of.

    So make sure all your new character materials have that same queue set (can be set per material, don't have to write a special shader for it).

    Indeed, just add it to the Scriptableobject (you can even make it an enum WeaponStyle, like

    Code (CSharp):
    1. public enum WeaponStyle
    2. {
    3.     Melee = 0,
    4.     Pistol = 1
    5. }
    6.  
    7. public WeaponStyle Style;
    then Style will appear on in the weapon data inspector as a dropdown with a proper name, and you can send that as a parameter to your animator to choose the right blend tree (or even just switch between 2 animator controller if you use totally different animation for all stage) by casting in (int)Style to make it back into an integer id.

    In a full game, I would even recomend using animation blending (so you can have a single leg animation for running, idle etc..) and just blend top body animation based on equiped weapon but that require a lot more change and we didn't have the animation for it, but that's a good "left as an exercise to the reader" :p
     
  31. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    104
    Just calling AttackEvent() from inside your new Hit function should work the same and will allow you to have a single place (the AttackEvent function) to modify

    Oh, that's brilliant! Gah! Why don't I think of these things??

    So make sure all your new character materials have that same queue set (can be set per material, don't have to write a special shader for it).

    Hmm... I'm using the LWRP Lit Shader, and that doesn't appear to be one of the exposed settings (I am shader illiterate, so pardon me if I'm not using the right words here). I tried switching to the same shader that Mike uses (ShaderGraph/MainRimShaderGraph) and that does kind of work, but I did still get weird blue artifacts when the character is facing away from the camera. Then I realized that there was a setting called Rim Color in that shader, and setting that to black (and the Render Queue to 2099) seems to have resolved my issue!

    Indeed, just add it to the Scriptableobject

    Brilliant! I'll let you know how it goes!
     
  32. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    104
    I think I found a typo. In CharacterData the Comment says "Agility reduce by 0.5% the cooldown to attack (e.g. if agility = 50, 25% faster to attack)"

    The code says:

    If you take a weapon with a speed of 1, and use the example agility of 50, this results in a new modified cooldown of 0.975.

    I think there's just an extra zero in the second float. If we change that to 0.01f, the new modified cooldown (of a speed of 1 and an agility of 50) is 0.75, which is a 25% reduction, and matches the Comment.

     
  33. Ozone42

    Ozone42

    Joined:
    Nov 11, 2019
    Posts:
    1
    As pointed out in the comments section in the tutorial, you can't save the project by pressing Ctrl + S, or from File > Save As... Ctrl + S will save the scene, not the project. There should be a File > Save Project As..., but there isn't. The only way to save your own copy of the project is by quitting the editor and then selecting Keep.

    This is very frustrating until you discover this. Like probably many other newcomers I spent quite some time until I discovered how to save my own copy of the project. Until you fix this is in the Unity editor, at least update the tutorial instructions which should be quick workaround.
     
  34. DimitrisGeo9

    DimitrisGeo9

    Joined:
    Mar 17, 2018
    Posts:
    2
    Hi guys I am trying this days to use creator kit beginner code to make my character move attack and collect. At the beginning everything works fine until a few seconds later he starts to walk in the direction I want but facing the wrong way so he looks like he is sliding and everything starts to be a mess.Did anyone manage to make it work? Does it has anything to do with me using a plane as an example and not a terrain? Because even when I use mike's avatar and animations to my character even if it isn't animating everything is working good and he is walking correctly but not when I use my avatar and animations for some reason.
     
  35. somi94

    somi94

    Joined:
    Mar 20, 2015
    Posts:
    2
    I'm pretty sure this is a problem with the lightweight render pipeline. Probably incompatibility with your OS or graphics driver. Facing the same problems using Ubuntu.

    Changing terrain material doesn't fix it for me. Had to disable lightweight pipeline (remove pipeline asset from Project Settings > Graphics) and assign the default terrain material to the terrain object. Sadly you have to reconfigure all materials to use Standard shader, as the shaders used seem to be incompatible with default pipeline. Have no solution for the outlines yet, and haven't checked if all particles are compatible with standard particle shader.
    Hard grind to get it working, of course look (and performance) differs a lot from intended version.
    I hope the pipeline get's fixed for "not windows users" :)

    edit: haven't tried to fix the pipeline itself yet, maybe i will try that too
     
  36. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    104
    I was able to get it to work just fine using some low poly cowboy models from Synty, and the RPG Animation set from Explosive. I didn't change the terrain, though, for my experiments, but I can't think of how changing it to a plane would affect anything (assuming that the Navigation got baked for the plane, which it would have to since the player moves with a NavMeshAgent).

    I didn't have any problems seeing the terrain in the game (or with it being rotated).

    After playing with it for a few days, I dropped this, but I did manage to implement shooting for both the player and the enemies. I got stuck when I tried to fiddle with the inventory, because I couldn't figure out how to let the player choose between various weapons (by default, your regular weapon is replaced when you pick up a new one, and you can't drop the one you have).

    Still, I found the framework to be pretty flexible to a point.
     
  37. DimitrisGeo9

    DimitrisGeo9

    Joined:
    Mar 17, 2018
    Posts:
    2
    I am making a game where you use abilities and new weapons but their use is time based so you have to use wisely your new weapons with better stats or the abilities or you will wait for the cooldown in order to collect a power up card to use so maybe you will find a way with a script and a philosophy of yours to make it to work since you do not have a way to discard by the kit.
    One more question I downloaded the rpg animation pack what changes should I make to use the animations? Because I want to use a generic character to play generic animations instead of humanoid , like the character in the kit.
     
  38. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    104
    First, I'm using a humanoid rig. This makes retargeting animations work.

    Generic animations are typically used for a specific model, so you can't retarget them to a different model (unless they happen to have the exact same skeleton and rig).

    Rig a humanoid character, copy the existing controller, and replace the animations with those from the rpg animation pack.

    If I were you, I'd start with one of the simpler packs to learn the basics of character movement and controls (there's one where you make a stealth game about a cat in a house that will get you up to speed).
     
  39. AmitTzuberi

    AmitTzuberi

    Joined:
    Oct 1, 2019
    Posts:
    4
    Hello Professionals,
    I started the Creator Kit: Beginner Code course after experimenting with unity software and got stuck in the last "customization" class.

    One of the tasks I was tasked with was to remove one unit from the inventory when the bool true was used.
    And in the second task of this task if the player's life is full the potion will not be used and no bool false will be removed.

    What should I think of when writing variables and classes?