Creating a custom PlayClipAtPoint functionThe AudioSource.PlayClipAtPoint() function doesn't let us have a lot of control over the Audio Source itself. So I created a custom class for this. using UnityEngine; using UnityEngine.Audio; public class AudioClipPlayer : MonoBehaviour { [Head...Apr 21, 2024 · 1 min readtheredmark.hashnode.dev
Unity: Hierarchy filling up with "New Game Object" objectsThis is a bug that occurred in my new game "Survivesmith" a while back. I've been ignoring it for too long and today, I decided to find a fix finally. I searched for a solution online and didn't quite get the answer. So I asked ChatGPT if it could ...Apr 21, 2024 · 2 min readtheredmark.hashnode.dev
Basic tower targeting systemWhen I first released the game, the enemy targeting system for the towers in Hyper Towers was to target whoever had the least displacement to the player's base. Today, I improved it a little bit, but it works a lot better now. I'm not sure how much o...Dec 5, 2023 · 3 min readtheredmark.hashnode.dev
Things I've learnedZ-position on instantiating prefabs: So apparently, whether you give a z position on your prefabs or not, it spawns right on the object it is instantiated on, ignoring the values given by you. Volume slider: I've made my volume slider in a way tha...Dec 4, 2023 · 3 min readtheredmark.hashnode.dev
Using script referencing rather than events and delegatesInitially, I only knew about using events and delegates to call a function from another script. I used it in all my earlier projects and this one as well. But I still don't quite understand how it works. Then I came across the other approach; Referen...Dec 4, 2023 · 1 min readtheredmark.hashnode.dev