Unity - How to Do Sprite Billboarding - Make 2D Sprites Face the Camera
Max O'Didily
Unity - How to Do Sprite Billboarding - Make 2D Sprites Face the Camera
Link to Unity C# code used in this tutorial for the camera controller: https://pastebin.com/gAW6vVGc
Greetings in this Unity tutorial we shall be looking at how to billboard sprites in Unity. Billboarding is a simple way to use 2D sprites in a 3D enviorment. Billboarding means we make a sprite always face the camera, to give an illusion of a 2D sprite not being flat. This was deployed in early 3D games where it was not feasible to use 3D models for everything at the time and now billboarding is a cool visual style for games.
Billboarding is really easy to do in Unity, you just need to do 2 lines of code:
transform.LookAt(cameraTransform) - this line makes the 2D sprite look at the camera.
transform.rotation = Quaternion.Euler(0, transform.rotation.eulerAngles.y, 0) - this line ensures the 2d sprite doesn't tilt and look wierd, this could happen if your camera was far above the sprite.
That is all you need to do to make a 2D sprite face the camera using billboarding.
If you found this Unity tutorial on how to billboard sprites, then be sure to subscribe for more Unity tutorials.
Thanks for watching this Unity tutorial on how to billboard sprites in Unity using C#
Unity - How to Do Sprite Billboarding - Make 2D Sprites Face the Camera
#gamedevelopment #gamedev #unity
This Unity tutorial on billboarding sprites should answer the following questions:
How to do billboarding in Unity How to add 2d characters in a 3D world in Unity How to Do Sprite Billboarding in Unity How to do billboarding in Unity - 2D sprites in 3D How I can create an sprite that always look at the camera Billboards in Unity (and how to make your own) 2D Sprites in 3D World - Sprite Billboarding Tutorial How to achieve 2.5D billboard sprite effect ... https://www.youtube.com/watch?v=gUeRdzD-e9U
12840502 Bytes