The Incredibly Useful Sine Waves PART 2 – More Applications – (Trigonometry) (Game Dev Primer)

If you didn’t read part 1, and want to get background on sine waves for game development. Click Here (PART 1).

If you did read it, or don’t care, please continue.

Last time it was all about the basic sine function and how to make game objects move in the shape of a sine wave. This time let’s take it a step further. I’m going to show you a few more practical applications of sine waves, that isn’t limited to just moving objects.


I think I used the word oscillate more than 6 times in the last post, but it’s the essence of sine waves. This post isn’t going to be too long, since I think you’ll catch on quick if you haven’t already. Basically what I’m telling you, is that if you want anything to smoothly move back and forth (oscillate) between two states, values, locations, etc, USE THE SINE FUNCTION.

Read More

The Incredibly Useful Sine Waves PART 1 – Using The Sin Function – (Trigonometry) (Game Dev Primer)

Don’t worry, this isn’t going to be a whole Trig class. I will however, go over one very useful trigonometric function that is easily overlooked by beginner, and even veteran game developers. The Sine Wave. Hopefully this will fuel your own curiosity to learn more about trigonometry and how applicable it is to the world of game development.

If you know what the Sine function is, fantastic, if not, I’m sure you’ve heard the term. You may have encountered it in high school geometry or trigonometry, and it’s applied in just about every field that involves some kind of math.

Sine waves are a graph of the Sine function, and given a basic form, as the input value changes, the output will oscillate between 1 and -1. Here’s what that looks like:

sine animation
Note: You may notice that the sine wave perfectly maps to a circle of radius 1. That form of circle is called a Unit Circle. Understanding it is helpful but not necessary. As I said this is not a trig class. Moving on.

Read More

Unity Simple 2D Rotation Script.

Category : 2D , C# , Full Script , Game Development , Unity

While working in Unity I found it difficult to figure out how to get an object to rotate. If you’re reading this, you probably did too. Right now I’m just talking about 2D game object rotation. The concept works in 3D as well, just turn on a different axis, but I won’t go into that here.

If you don’t feel like reading the article and just want the Full Script… skip to the bottom.

Add this to the property section of your class:

This will be the variable that tells the script how fast to rotate around the axis. It’s in degrees per second. Feel free to play with the number as see how it affects the rotation speed.

Read More

Show Some Love

Support The Weekly Coder on Patreon!


Recent Popular Info

This channel is all about coding. We will mostly post tutorials on making games with Unity 5 and above. Other posts will include tutorials on specific game mechanics and whatever else we feel like talking about.

Don't be shy.. If you have a question, leave a comment. If you you'd like to see a specific tutorial feel free to request it. If we think its worthwhile, then we may just do it.

Please don't forget to click the like button and remember to subscribe. Feel free to support our channel and the awesome content we create.

Total subscribers:

Total uploads:

Total upload views:
89.1 thousand

Follow me on Twitter


RSS Feed

Blog Authors