This post provides a handy reference guide to go from Scratch’s “Operators” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. int score = 5 + 6; // 11 int age = score…
Month: July 2019
This post provides a handy reference guide to go from Scratch’s “Sensing” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. void OnMouseOver() { // Code to run when mouse is touching }…
This post provides a handy reference guide to go from Scratch’s “Control” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. IEnumerator Start() { // Optional code here yield return new WaitForSeconds(1f); //…
This post provides a handy reference guide to go from Scratch’s “Events” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. Most of the time, you will probably use the “Start” method as…
This post provides a handy reference guide to go from Scratch’s “Sound” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. You program over time using a Coroutine. Unfortunately there is no “Wait…
This post provides a handy reference guide to go from Scratch’s “Looks” category of code blocks to C# with Unity. Code Blocks Click on the picture of any of these Scratch code blocks to see how to write similar code statements in C#. There is no direct equivalent to the “say” and “think” code blocks…
This post provides a handy reference guide to go from Scratch’s “Motion” category of code blocks to C# with Unity. Code Alternatives Before you dive in, I wanted the opportunity to present a few alternatives for your animation needs. Unity has a lot of features you wont find in Scratch, so doing things the “Scratch…
Scratch has several code blocks that can take time to complete. For example, you might chain together several “say” blocks to present a conversation. Each block will then pause the execution of that stack until it completes. Up to this point, all of the code we have learned has been synchronous. This means that even…
Scratch makes it very simple to “do” things with your sprites by stacking a few well placed code blocks. In Unity, you must “script” your actions with a programming language called C# (pronounced ‘C Sharp’). If you’ve never programmed before, then this will likely be the single greatest hurdle in transitioning from Scratch to Unity,…
The layouts of Scratch and Unity are pretty different, and Unity can be a bit overwhelming by comparison. That is an unfortunate by-product of having so many features. It’s not as bad as you might think though, we just need to re-orient you by letting you know the equivalent location of where and what things…