Uploaded June 2017 | Updated September 2026, 2 weeks ago
In this video we determine an equation for the shortest distance between some point C, and the line passing through points A and B.
The equation is: dst = abs((C.x-A.x) * (-B.y+A.y) + (C.y-A.y) * (B.x-A.x)) / sqrt((-B.y+A.y)^2 + (B.x-A.x)^2)
We also see how this equation can be modified to determine if two points lie on the same side of a line.
C# code for the equations can be found here: github.com/SebLague/Gamedev-Maths/blob/master/DistanceToLine.cs
If you'd like to support these videos, you can do so with a recurring pledge on Patreon, or a one-time donation through PayPal. patreon.com/SebastianLague
paypal.me/SebastianLague
In this video we determine an equation for the shortest distance between some point C, and the line passing through points A and B.
The equation is: dst = abs((C.x-A.x) * (-B.y+A.y) + (C.y-A.y) * (B.x-A.x)) / sqrt((-B.y+A.y)^2 + (B.x-A.x)^2)
We also see how this equation can be modified to determine if two points lie on the same side of a line.
C# code for the equations can be found here: github.com/SebLague/Gamedev-Maths/blob/master/DistanceToLine.cs
If you'd like to support these videos, you can do so with a recurring pledge on Patreon, or a one-time donation through PayPal. patreon.com/SebastianLague
paypal.me/SebastianLague
![RPG graphics E05: Run animation [Blender]
In this episode we create a basic run and idle animation for the character.
See Brackeys channel for the programming half of this series: https://www.youtube.com/user/Brackeys
Run animation reference sheet:
https://www.dropbox.com/s/mokhspbia1g6wn9/run%20ref.jpg?dl=0
Download end-of-video file here:
https://www.dropbox.com/s/9aginok90hk5wjc/Player%20run%20anim.zip?dl=1
Download start-of-video file here:
https://www.dropbox.com/s/pkm46h431r9akss/Player%20walk%20anim.zip?dl=1
RPG gameplay programming playlist:
https://www.youtube.com/playlist?list=PLPV2KyIb3jR4KLGCCAciWQ5qHudKtYeP7
Support the creation of more gamedev tutorials:
https://www.patreon.com/SebastianLague RPG graphics E05: Run animation [Blender]](https://i.ytimg.com/vi/L3FJVQbnllc/mqdefault.jpg)

![[Unity 5] Object Pooling Tutorial
Object pooling is an optimisation technique which is extremely helpful for boosting the performance of mobile games. The basic idea is to recycle a pool of objects, rather than continually instantiating and destroying new ones.
UPDATE:
At ~15:16 in the video, the lines copied should preferably be pasted BEFORE the call to OnObjectReuse(), so that when that method is called, the object will already have its correct position/rotation values. This could be important when resetting certain things, for example the velocity of a projectile based on its initial rotation.
Source code:
https://github.com/SebLague/Object-Pooling
Support my videos on Patreon:
http://bit.ly/sebPatreon [Unity 5] Object Pooling Tutorial](https://i.ytimg.com/vi/LhqP3EghQ-Q/mqdefault.jpg)
![[Unity] Procedural Planets (E02 settings editor)
In this episode well be creating a custom settings inspector for the planet.
Get the project files for this episode:
http://github.com/SebLague/Procedural-Planets
Support the creation of more tutorials and get early access to new videos: https://www.patreon.com/SebastianLague [Unity] Procedural Planets (E02 settings editor)](https://i.ytimg.com/vi/LyV7cEQyZMk/mqdefault.jpg)



![[Ludum Dare #43] The Resistance: Behind the Scenes
A game about batteries. Made in 48 hours for the Ludum Dare 43 game jam.
https://ldjam.com/events/ludum-dare/43/the-resistance
Support the creation of more tutorials and get early access to new videos: https://www.patreon.com/SebastianLague [Ludum Dare #43] The Resistance: Behind the Scenes](https://i.ytimg.com/vi/MoQ5OapRI2c/mqdefault.jpg)


![RPG graphics E08: Icons [Blender]
In this episode we render out images of each of the pieces of armour, to be used as inventory icons.
See Brackeys channel for the programming half of this series: https://www.youtube.com/user/Brackeys
RPG gameplay programming playlist:
https://www.youtube.com/playlist?list=PLPV2KyIb3jR4KLGCCAciWQ5qHudKtYeP7
Support the creation of more gamedev tutorials:
https://www.patreon.com/SebastianLague RPG graphics E08: Icons [Blender]](https://i.ytimg.com/vi/NLYzM9jK1lA/mqdefault.jpg)