{"id":1264,"date":"2025-05-10T17:43:24","date_gmt":"2025-05-10T17:43:24","guid":{"rendered":"https:\/\/sites.wsagames.com\/et4g23\/?p=1264"},"modified":"2025-05-14T15:16:45","modified_gmt":"2025-05-14T15:16:45","slug":"wrought-pt-2","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/","title":{"rendered":"Wrought &#8211; Pt 2"},"content":{"rendered":"\n<p class=\"has-text-align-center has-background\" style=\"background-color:#dfdfdf\">A large issue I had noticed with the Wrought enemies, was that in order to aim towards the player, the entire gameobject would rotate in the direction of the player. Therefore, its sprite would also rotate towards the player; which needed to be fixed immediately.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"713\" height=\"352\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png\" alt=\"\" class=\"wp-image-1265\" style=\"width:840px;height:auto\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png 713w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52-300x148.png 300w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<p>The process I chose to fix this issue, was to use a child object which would rotate independently of the parent object that would have the Sprite Renderer and Animator components. This child object would act as the sprite renderer and would rotate in the opposite direction of the parent object, effectively counteracting the rotation and causing the Wrought&#8217;s sprite to appear as if it weren&#8217;t rotating at all.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"819\" height=\"471\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-55.png\" alt=\"\" class=\"wp-image-1268\" style=\"width:840px;height:auto\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-55.png 819w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-55-300x173.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-55-768x442.png 768w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/figure>\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<p>Furthermore there would also be a second child object that would act as a hitbox:<br>To allow the child object to deal damage to the player, I wrote a simple script that would check if any collisions were from the player.<\/p>\n\n\n\n<p>If the player was the other object in the collision, it would call the <strong><em>TakeDamage()<\/em><\/strong> method in the player&#8217;s <em><strong>PlayerHealth script<\/strong><\/em> and cause the player to take one HP of damage.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"546\" height=\"442\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-54.png\" alt=\"\" class=\"wp-image-1267\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-54.png 546w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-54-300x243.png 300w\" sizes=\"(max-width: 546px) 100vw, 546px\" \/><\/figure>\n<\/div>\n<\/div>\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-1-2.mp4\"><\/video><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Bug fixing<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"170\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-56.png\" alt=\"\" class=\"wp-image-1271\" style=\"width:840px;height:auto\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-56.png 649w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-56-300x79.png 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p>When creating a separate child object for the sprite renderer, it cause a lot of unintended issues with the physics of the game. As the parent object would act as the hitbox, its has a RigidBody2D component to allow it to collide with walls and stalagmite obstacles in the dungeons. However, the child object containing the sprite renderer didn&#8217;t have one. This would cause the parent object and the child object to misalign whenever a collision would take place.<\/p>\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<p>To fix this, I gave the child object a RigidBody2D component and altered its mass for collisions.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"78\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-58.png\" alt=\"\" class=\"wp-image-1274\" style=\"width:416px;height:auto\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-58.png 384w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-58-300x61.png 300w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>The invisible Wroughts issue, however, was a much easier fix. Simply going into the Wrought prefab&#8217;s sprite renderer component and changing its Order in Layer to be higher than the Dungeon&#8217;s floors made it visibly in the Dungeon.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"176\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138-1024x176.png\" alt=\"\" class=\"wp-image-1464\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138-1024x176.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138-300x51.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138-768x132.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138-850x146.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-138.png 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This bug was caused by values that weren&#8217;t being set, specifically the Velocity X and Velocity Y values, as these values were being used by the animator in Unity to decide what walking and attacking animation to play for the Wrought.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"124\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139-1024x124.png\" alt=\"\" class=\"wp-image-1466\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139-1024x124.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139-300x36.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139-768x93.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139-850x103.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-139.png 1064w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A large issue I had noticed with the Wrought enemies, was that in order to aim towards the player, the entire gameobject would rotate in the direction of the player. Therefore, its sprite would also rotate towards the player; which needed to be fixed immediately. The process I chose to fix this issue, was to&#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-1264","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>Wrought - 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\/wrought-pt-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wrought - Pt 2 - E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"og:description\" content=\"A large issue I had noticed with the Wrought enemies, was that in order to aim towards the player, the entire gameobject would rotate in the direction of the player. Therefore, its sprite would also rotate towards the player; which needed to be fixed immediately. The process I chose to fix this issue, was to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/\" \/>\n<meta property=\"og:site_name\" content=\"E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-10T17:43:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-14T15:16:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.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=\"3 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\/wrought-pt-2\/\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/\",\"name\":\"Wrought - 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\/wrought-pt-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png\",\"datePublished\":\"2025-05-10T17:43:24+00:00\",\"dateModified\":\"2025-05-14T15:16:45+00:00\",\"author\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963\"},\"breadcrumb\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#primaryimage\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png\",\"contentUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png\",\"width\":713,\"height\":352},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sites.wsagames.com\/et4g23\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wrought &#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":"Wrought - 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\/wrought-pt-2\/","og_locale":"en_US","og_type":"article","og_title":"Wrought - Pt 2 - E-Jay Tripoli (Year 2 Archive)","og_description":"A large issue I had noticed with the Wrought enemies, was that in order to aim towards the player, the entire gameobject would rotate in the direction of the player. Therefore, its sprite would also rotate towards the player; which needed to be fixed immediately. The process I chose to fix this issue, was to...","og_url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/","og_site_name":"E-Jay Tripoli (Year 2 Archive)","article_published_time":"2025-05-10T17:43:24+00:00","article_modified_time":"2025-05-14T15:16:45+00:00","og_image":[{"url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png","type":"","width":"","height":""}],"author":"et4g23","twitter_card":"summary_large_image","twitter_misc":{"Written by":"et4g23","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/","url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/","name":"Wrought - 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\/wrought-pt-2\/#primaryimage"},"image":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#primaryimage"},"thumbnailUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png","datePublished":"2025-05-10T17:43:24+00:00","dateModified":"2025-05-14T15:16:45+00:00","author":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963"},"breadcrumb":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#primaryimage","url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png","contentUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-52.png","width":713,"height":352},{"@type":"BreadcrumbList","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/10\/wrought-pt-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sites.wsagames.com\/et4g23\/"},{"@type":"ListItem","position":2,"name":"Wrought &#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\/1264","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=1264"}],"version-history":[{"count":4,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1264\/revisions"}],"predecessor-version":[{"id":1685,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1264\/revisions\/1685"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/media?parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/categories?post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/tags?post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}