Posts

Showing posts from June, 2019

How to make neon light signs in Unity 3D

Image
As part of my game, I was trying to create a whole apartment like environment. I decided to call it a motel instead. So I had to put a sign saying it's a motel( how else would people know right? ) To create the simple glowing text you need text mesh pro. It's available in Asset Store as well as in Unity Package manager. Inside Unity, go to Window > Package Manager and search for text mesh pro. Now go to Game Object > 3D Object > Text Mesh Pro Text Now enter whatever text you want and select distance field shader in text mesh pro inspector tab. See image below. Once selected you'll be able to see a number of settings under shader and can enable glow from there. I'd recommend playing with numbers here to suit your scene.  Now that you have your glowing text if you want more you'll notice they seem to be using the same shader which will cause a problem if you want glow signs in different colours. For this, we need to creat

Making Sensor Lights in Unity 3D

Image
Lighting in Unity 3D can some times get tricky. I just spent hours into making sensor lights only to come up with a very obvious solution. At first, I was using baked maps which were the primary reason for my trouble. I know it's kind of obvious but I need to state it for anyone who is struggling with the same. Don't use Baked Lightmaps if you want real-time illumination. As simple as that. I even considered lighting up the environment by real-time switching different lightmaps. Thanks to the complexity of such task I didn't do it. Finally, the solution was to use simple point lights. To give the lights better look I used emissive materials. Here are the results.         Here's how I did it. Created an empty Gameobject Light Controller and under that created two small cuboid, LightsOn and LightsOff and a point light called Bulb here. Added a box collider in Light Controller and ticked Is Trigger .   Here's the script attached to the Light Con