{"id":596,"date":"2025-05-03T15:09:42","date_gmt":"2025-05-03T15:09:42","guid":{"rendered":"https:\/\/sites.wsagames.com\/jb19g23\/?p=596"},"modified":"2025-05-14T20:35:39","modified_gmt":"2025-05-14T20:35:39","slug":"learning-unity","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/jb19g23\/2025\/05\/03\/learning-unity\/","title":{"rendered":"Learning Unity"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is going to be everything that I am learning and experimenting with as I have never &#8216;coded&#8217; or even used uinty before. I am self teaching with various vidoes online which I will link as I go on. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"The Unity Tutorial For Complete Beginners\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/XtQMytORBmM?start=146&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Unity uses C# which is one of the most popular coding languages in the world due to its heavy use in Windows products. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"571\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-13-1024x571.png\" alt=\"\" class=\"wp-image-597\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-13-1024x571.png 1024w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-13-300x167.png 300w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-13-768x428.png 768w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-13.png 1256w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Unity has 4 panels by default:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>project contains all the &#8216;game&#8217; items.\n<ul class=\"wp-block-list\">\n<li>sounds<\/li>\n\n\n\n<li>models<\/li>\n\n\n\n<li>code<\/li>\n\n\n\n<li>textures<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Hierarchy lists all the GameObjects in the current level<\/li>\n\n\n\n<li>Inspector allows us to interact with the GameObjects and the scene is what will be seen by the player and how we view everything. <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Every rigid body object will need to also have colliders if they want to interact with the GameObjects. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"974\" height=\"623\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-14.png\" alt=\"\" class=\"wp-image-598\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-14.png 974w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-14-300x192.png 300w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-14-768x491.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Start runs at the very start of the script and only runs once<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update will run every single frame until the script is ended<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"624\" height=\"310\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-15.png\" alt=\"\" class=\"wp-image-599\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-15.png 624w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-15-300x149.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">gameobject refers to the game object that the script is attatched toand anything after the &#8216;.&#8217; specifies to the code what about the game object is being selected to be coded. &#8216;.name&#8217; refers to the name of the object which can be changed to &#8216;Bob Birdington&#8217;. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8216;;&#8217; semi-colons end a line of code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">scirpts have to be saved before re-entering unity<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To simplify it is like choosing someone to talk to, something to talk about, and a command. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"454\" height=\"57\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-16.png\" alt=\"\" class=\"wp-image-600\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-16.png 454w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-16-300x38.png 300w\" sizes=\"(max-width: 454px) 100vw, 454px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The script is extremly perdantic and doesn&#8217;t actually know who is in the room with it. By telling it that there is a rigid body in the room, it can now interact with it and also give it all the properties in unity. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17-1024x504.png\" alt=\"\" class=\"wp-image-601\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17-1024x504.png 1024w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17-300x148.png 300w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17-768x378.png 768w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17-1536x757.png 1536w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-17.png 1827w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">1 = is to make ie;  if x is 3 typing in the code x=2 will make it 2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2== checks  the x value; x== 2 is incorrect so it returns as false<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"344\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-19.png\" alt=\"\" class=\"wp-image-603\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-19.png 706w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-19-300x146.png 300w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As said previously update runs every frame. If\/Else statements contain these inputs to make sure they dont run all the time. in this instance, If the key that has been pressed down is the space bar, the rigid body will move up. This will happen every time the space bar is pressed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Public variables allow unity code to be edited in the unity inspector as opposed to opening and closing the code to change variables<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"639\" height=\"596\" src=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-20.png\" alt=\"\" class=\"wp-image-604\" srcset=\"https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-20.png 639w, https:\/\/sites.wsagames.com\/jb19g23\/wp-content\/uploads\/sites\/4\/2025\/03\/image-20-300x280.png 300w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Parent and child objects just act like leashes. The parent controls all of its children and makes it so objects can be moved around easily as a group. However, we can still edit the child objects individually from the parent. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">int : represents an positive or negative integer number; float : represents a &#8220;floating point number&#8221;, i.e., a non-integer number; str : represents some alphanumeric text, know as a &#8220;string&#8221;; bool : represents a boolean value, i.e., &#8220;True&#8221; or &#8220;False&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is going to be everything that I am learning and experimenting with as I have never &#8216;coded&#8217; or even used uinty before. I am self teaching with various vidoes online which I will link as I go on. Unity uses C# which is one of the most popular coding languages in the world due [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,25],"tags":[],"class_list":["post-596","post","type-post","status-publish","format-standard","hentry","category-blogs-term-2","category-term-2"],"_links":{"self":[{"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/posts\/596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/comments?post=596"}],"version-history":[{"count":1,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/posts\/596\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/posts\/596\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/media?parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/categories?post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/jb19g23\/wp-json\/wp\/v2\/tags?post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}