{"id":1378,"date":"2025-05-10T23:16:13","date_gmt":"2025-05-10T23:16:13","guid":{"rendered":"https:\/\/sites.wsagames.com\/et4g23\/?p=1378"},"modified":"2025-05-12T16:10:17","modified_gmt":"2025-05-12T16:10:17","slug":"skill-tree-pt-2","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/","title":{"rendered":"Skill Tree &#8211; Pt 2"},"content":{"rendered":"\n<p class=\"has-text-align-center has-background\" style=\"background-color:#dfdfdf\">Now that the UI for the Skill Tree was set up, I needed to program and develop the hard part.<br>Getting the Skill Buttons to work when pressed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"424\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png\" alt=\"\" class=\"wp-image-1379\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-300x124.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-768x318.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-850x352.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99.png 1144w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Customizable skill buttons mean skill buttons that can unlock different types of skills &#8211; A robust system for creating a skill tree<\/li>\n\n\n\n<li>Terra Shard UI counter would have to update depending on Terra Shards spent and the players current terra shard count<\/li>\n\n\n\n<li>Skills can be locked &#8211; preventing the player from spending Terra Shards on them<\/li>\n\n\n\n<li>Terra Shards must be used as the currency to upgrade skills and can be increased by killing enemies in the dungeon<\/li>\n\n\n\n<li>Prerequisite skills function &#8211; certain skills must be purchased before other skills can be unlocked<\/li>\n<\/ol>\n\n\n\n<p>To set up the Skills System, it requires three scripts:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SkillSO script <\/strong>&#8211; A scriptable object script that handles data about each skill<\/li>\n\n\n\n<li><strong>SkillSlot script <\/strong>&#8211; Handles each skill button (What skills need to be unlocked before it etc.)<\/li>\n\n\n\n<li><strong>SkillTreeManager script <\/strong>&#8211; Communicates between all skill scripts (Handles spending Terra Shards to buy skills etc.)<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">SkillSO Script<\/h2>\n\n\n\n<p>What is a scriptable object in unity? The following is directly from the <a href=\"https:\/\/docs.unity3d.com\/Manual\/class-ScriptableObject.html\">Unity&#8217;s Documentation<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"319\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102-1024x319.png\" alt=\"\" class=\"wp-image-1383\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102-1024x319.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102-300x93.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102-768x239.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102-850x264.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-102.png 1083w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The reason I make the SkillSO script call from ScriptableObject as opposed to MonoBehaviour, is that it is able to save memory when running the project, as all of its values are never changed throughout the game. They are only ever set in the Unity editor before the game is run.<\/p>\n\n\n\n<p>This is the SkillSO script, the <strong><em>CreateAssetMenu <\/em>attribute <\/strong>allows me to create more <em><strong>ScriptableObjects <\/strong><\/em>much easier (&#8220;<strong>Attributes <\/strong>in C# are&nbsp;<strong>metadata markers <\/strong>that can be<strong> placed above <\/strong>a <strong>class, property, or method declaration <\/strong>to <strong>indicate special behaviour<\/strong>&#8221; &#8211; <a href=\"https:\/\/docs.unity3d.com\/6000.0\/Documentation\/Manual\/unity-attributes.html#:~:text=Attributes%20in%20C%23%20are%20metadata,custom%2C%20Unity%2Dspecific%20attributes.\">Unity Documentation<\/a>). However, the main use of the SkillSO script is to store data about certain skills, hence the public data types for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A<strong><em> string <\/em><\/strong>called <strong><em>skillName<\/em><\/strong><\/li>\n\n\n\n<li>An <em><strong>int <\/strong><\/em>called <em><strong>maxLevel<\/strong><\/em><\/li>\n\n\n\n<li>A <em><strong>Sprite <\/strong><\/em>called <em><strong>skillIcon<\/strong><\/em> (The sprite that will be used for the SkillButton&#8217;s Image)<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fe6f147f593&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"577\" height=\"312\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-101.png\" alt=\"\" class=\"wp-image-1382\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-101.png 577w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-101-300x162.png 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fe6f147f949&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"695\" height=\"330\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-103.png\" alt=\"\" class=\"wp-image-1384\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-103.png 695w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-103-300x142.png 300w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">SkillSlot Script<\/h2>\n\n\n\n<p>Firstly, for the Skill Button to know when to be unlocked, there is a public list of skills that can be assigned to in the hierarchy which must be acquired before the target skill can be unlocked, In order for the SkillSlot to have access to data about the skill, it needs a reference to the SkillSO, hence <em><strong>public SkillSO skillSO<\/strong><\/em>. Then, there are two ints and bools to do with purchasing and being able to purchase a skill.<\/p>\n\n\n\n<p>Then, in the <em><strong>OnValidate()<\/strong><\/em> method (This method runs when changes are made to a script&#8217;s variables) a check is made to see if the SkillSlot even has a reference to a SkillSO or the skill&#8217;s level text. If this is the case, the <em><strong>UpdateUI() <\/strong><\/em>method is called which updates the SkillIcon&#8217;s sprite to the SkillSO&#8217;s sprite. Afterwards, it checks if the skill is unlocked to determine whether to grey out the skill if it is locked or not and updates the CostText text to show how many Terra Shards the player has spent on that skill.<\/p>\n\n\n\n<p>In the <em><strong>TryUpgradeSkill() <\/strong><\/em>method, the skill is checked to see if it is unLocked and whether its current level is less than its max level, if this is the case its currentLevel is increased and the <strong><em>OnAbilityPointSpent event<\/em><\/strong> notifies <strong>listeners <\/strong>(i.e the SkillTreeManager script). However, after the currentLevel is increased, it checks if the new currentLevel is now equal to or greater than that level&#8217;s maxlevel. If it is, then the <em><strong>OnSkillMaxed event <\/strong><\/em>notifies <strong>listeners <\/strong>(i.e the SkillTreeManager script).<\/p>\n\n\n\n<p>The <strong><em>CanUnlockSkill() <\/em><\/strong>method checks all <strong>SkillSlots <\/strong>in the <em><strong>prerequisiteSkillSlots list<\/strong><\/em> to see if all the prerequisite skills are all purchased for that <strong>SkillSlot<\/strong>, if they are, then <strong>that <\/strong><em><strong>CanUnlockSkill()<\/strong><\/em> method returns true.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fe6f147fdce&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"396\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104-1024x396.png\" alt=\"\" class=\"wp-image-1385\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104-1024x396.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104-300x116.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104-768x297.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104-850x329.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-104.png 1517w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">SkillTreeManager Script<\/h2>\n\n\n\n<p>To start the script, there are references for an array of SkillSlots, the text for TerraShard count, the player gameobject and the PlayerInventory script &#8211; which will all be used later in the script.<\/p>\n\n\n\n<p>In the <strong><em>OnEnable() <\/em><\/strong>and <em><strong>OnDisable() <\/strong><\/em>methods subscribe or unsubscribe from the SkillSlots&#8217;s <strong><em>OnAbilityPointSpent()<\/em><\/strong> and <em><strong>OnSkillMaxed() <\/strong><\/em><strong>events <\/strong>and cause the SkillTreeManager to call the <strong><em>HandleAbilityPointsSpent() <\/em><\/strong>method or the <strong><em>HandleSkillMaxed()<\/em><\/strong> method with that specific SkillSlot as an input for those methods. Essentially checking if a Terra Shard can be spent on that skill or if that skill is maxed out.<br>If a Terra Shard can be spent, the<em><strong> UpdateAbilitPoints(int amount) <\/strong><\/em>method is called which takes in an int and reduces the player&#8217;s currentTerraShards count.<br>If a skill is maxed out the <em><strong>HandleSkillMaxed(SkillSlot skillSlot)<\/strong><\/em> method is called which checks all <strong>SkillSlots <\/strong>in the <strong><em>skillSlots[] array<\/em><\/strong>, if a skill is locked and the a <strong>SkillSlot&#8217;s <em>CanUnlockSkill()<\/em><\/strong> method returns true, then <em>that <\/em><strong>SkillSlot&#8217;s Skill Button<\/strong> becomes available to be purchased with Terra Shards.<\/p>\n\n\n\n<p>In the Start() method, references to the PlayerInventory script and the amount of available Terra Shards the player has to spend is set. There is also an <em><strong>AddListener()<\/strong><\/em> function that is used on each <em><strong>SkillSlot <\/strong><\/em>in the <em><strong>SkillSlots array<\/strong><\/em> if the button corresponding to that SkillSlot is pressed, hence <em><strong>slot.skillButton.onClick<\/strong><\/em>. The <em><strong>CheckAvailablePoints(slot)<\/strong><\/em> method is called, which will check if the player has more than one Terra Shard to spend, if this is the case, the SkillSlot&#8217;s <em><strong>TryUpgradeSkill() <\/strong><\/em>method is called.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fe6f1480107&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"392\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105-1024x392.png\" alt=\"\" class=\"wp-image-1386\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105-1024x392.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105-300x115.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105-768x294.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105-850x325.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-105.png 1535w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Current Prototype<\/h2>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/Untitled-video-Made-with-Clipchamp-6.mp4\"><\/video><\/figure>\n\n\n\n<p>At this point, the player is able to click on a Skill Button and it would unlock it. Shown by the cost text reading &#8216;1\/1&#8217; and the Terra Shard counter decreasing by 1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that the UI for the Skill Tree was set up, I needed to program and develop the hard part.Getting the Skill Buttons to work when pressed. To set up the Skills System, it requires three scripts: SkillSO Script What is a scriptable object in unity? The following is directly from the Unity&#8217;s Documentation: The&#8230;<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1378","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"og:description\" content=\"Now that the UI for the Skill Tree was set up, I needed to program and develop the hard part.Getting the Skill Buttons to work when pressed. To set up the Skills System, it requires three scripts: SkillSO Script What is a scriptable object in unity? The following is directly from the Unity&#8217;s Documentation: The...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/\" \/>\n<meta property=\"og:site_name\" content=\"E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-10T23:16:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-12T16:10:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png\" \/>\n<meta name=\"author\" content=\"et4g23\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"et4g23\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/\",\"name\":\"Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)\",\"isPartOf\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png\",\"datePublished\":\"2025-05-10T23:16:13+00:00\",\"dateModified\":\"2025-05-12T16:10:17+00:00\",\"author\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963\"},\"breadcrumb\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99.png\",\"contentUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99.png\",\"width\":1144,\"height\":474},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sites.wsagames.com\/et4g23\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Skill Tree &#8211; Pt 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#website\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/\",\"name\":\"E-Jay Tripoli (Year 2 Archive)\",\"description\":\"A documentation of my work for Year 2 - Studying Games Design and Art at the University of Southampton\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sites.wsagames.com\/et4g23\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963\",\"name\":\"et4g23\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g\",\"caption\":\"et4g23\"},\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/author\/et4g23\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/","og_locale":"en_US","og_type":"article","og_title":"Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)","og_description":"Now that the UI for the Skill Tree was set up, I needed to program and develop the hard part.Getting the Skill Buttons to work when pressed. To set up the Skills System, it requires three scripts: SkillSO Script What is a scriptable object in unity? The following is directly from the Unity&#8217;s Documentation: The...","og_url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/","og_site_name":"E-Jay Tripoli (Year 2 Archive)","article_published_time":"2025-05-10T23:16:13+00:00","article_modified_time":"2025-05-12T16:10:17+00:00","og_image":[{"url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png","type":"","width":"","height":""}],"author":"et4g23","twitter_card":"summary_large_image","twitter_misc":{"Written by":"et4g23","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/","url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/","name":"Skill Tree - Pt 2 - E-Jay Tripoli (Year 2 Archive)","isPartOf":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage"},"image":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage"},"thumbnailUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99-1024x424.png","datePublished":"2025-05-10T23:16:13+00:00","dateModified":"2025-05-12T16:10:17+00:00","author":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963"},"breadcrumb":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#primaryimage","url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99.png","contentUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-99.png","width":1144,"height":474},{"@type":"BreadcrumbList","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/skill-tree-pt-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sites.wsagames.com\/et4g23\/"},{"@type":"ListItem","position":2,"name":"Skill Tree &#8211; Pt 2"}]},{"@type":"WebSite","@id":"https:\/\/sites.wsagames.com\/et4g23\/#website","url":"https:\/\/sites.wsagames.com\/et4g23\/","name":"E-Jay Tripoli (Year 2 Archive)","description":"A documentation of my work for Year 2 - Studying Games Design and Art at the University of Southampton","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sites.wsagames.com\/et4g23\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963","name":"et4g23","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g","caption":"et4g23"},"url":"https:\/\/sites.wsagames.com\/et4g23\/author\/et4g23\/"}]}},"_links":{"self":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/comments?post=1378"}],"version-history":[{"count":6,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1378\/revisions"}],"predecessor-version":[{"id":1597,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1378\/revisions\/1597"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/media?parent=1378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/categories?post=1378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/tags?post=1378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}