For 3D objects, use this script: For UI 2D objects, use this instead:
Category: Unity
How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
Have you ever encountered this annoying issue in Unity? You have a clickable 3D object (using OnMouseDown, raycasting, etc.), and you also have a UI canvas with buttons or interactive elements. When the player clicks a UI button, the 3D object behind it also registers the click — even though the UI is clearly on…
Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
Welcome to the guide for using Ciihuy Curved Mesh.This tool allows you to automatically create pipe or cable meshes in Unity, directly from points you define. First, add the CiihuyCurvedMesh script to an empty GameObject in your scene.Then, in the Inspector, you’ll see the Points list. Add several Empty GameObjects to this list as your…
Simple script to set and change the skybox, fog and so on in Unity
In this article, we will discuss how to create a script in Unity that automatically applies several important settings when the game starts. This script will enable fog, change the skybox material, destroy objects with a specific tag, and spawn a prefab at a specified location. All of these tasks will be executed when the…
Optimizing Performance in Open-World Games: A Simple Unity Script for Enabling/Disabling Static Objects Based on Player Distance
When developing large-scale open-world games, one of the biggest challenges is maintaining performance while creating a dynamic and immersive environment. One way to optimize game performance is by managing the number of objects that are active in the scene at any given time. In this article, we’ll explore a simple yet effective Unity script that…
A theory about how to make a game with huge map like GTA in Unity
Creating a huge game map with minimal memory usage and lag, similar to how GTA achieves its expansive worlds, involves a combination of optimization techniques, asset management, and intelligent world streaming. Here are key strategies to help you achieve this in Unity: 1. Level of Detail (LOD) 2. World Streaming (Chunking) 3. Occlusion Culling 4….
Simple example how to interact with sqlite database in Unity and C#
Here is a script called SQLiteManager: Explanation: Make sure to import Mono.Data.Sqlite and add the SQLite package to your Unity project (sqlite3.dll for Windows, libsqlite3.so for Android if needed).
AdMob vs. Unity Ads: Which One is More Profitable for Monetizing Mobile Horror Games?
Monetizing mobile games, especially in the horror genre, requires a well-thought-out strategy. Horror games often have a niche yet highly engaged audience, making ad monetization an essential revenue stream. Two of the most popular ad networks for mobile game developers are Google AdMob and Unity Ads. But which one is more profitable for monetizing mobile…
Unity C# Third Person Camera Occlusion Script
Here is a C# script for Unity that ensures a third-person camera moves closer to the player when an object obstructs the view. This script utilizes raycasting to detect occlusion and adjust the camera’s position accordingly. How It Works: You can adjust:
Minimum PC Hardware Requirements for a Smooth Unity Game Development Experience
If you’re planning to develop a game using Unity, having a capable PC is essential for a smooth workflow, especially when it comes to resource-intensive processes like light baking. Unity’s Global Illumination (GI) system, particularly when using the Progressive Lightmapper, requires significant computational power to produce high-quality lighting results efficiently. In this article, we’ll discuss…
Very simple unity C# code to integrate Google Play Asset Bundle on runtime
Here’s a simple Unity C# script to load an AssetBundle from Google Play Asset Delivery at runtime. This example assumes you have already set up Google Play Asset Delivery in your Unity project and uploaded asset bundles to Google Play Console. Steps: C# Code for Loading an AssetBundle at Runtime This script demonstrates how to…
Unity random mesh spawner at certain position C# script
In this blog post I will share a simple script that I’ve made to randomize what game object to be instantiated at a certain position as a child game object. For example, a car game object needs random accessories to be instantiated at certain area of the car… bla bla bla. This is the script:…
How to downgrade to Unity Ads version 4.4.2 ?
I am using Unity Ads and very happy. Recently there is a newer version of Unity Ads, which is version 4.12.0 and somehow I got problem when exporting my game as Android apk. I realized that this update is useless to me. I tried to downgrade to version 4.4.2 and everything is okay just like…
How to make a mobile airplane / aircraft simulator game easily
Hello guys. There is a nice free and open source project on GitHub that you can use to make your airplane mobile game. Check out this aircraft physic source code on GitHub: https://github.com/gasgiant/Aircraft-Physics/tree/master Well, the example scene is working fine and you can control your airplane using keyboard. But what if we want to make…
How to make Unity multiplayer game using Photon Fusion
In this blog post I will share some video tutorials about how to make your own Unity multiplayer game using Photon Fusion for free… Here is the list of videos: 1. Introduction 2. Basic example 3. Player Nickname – Basic 4. Player Nickname – Random Nickname 5. Player Nickname – Custom Nickname 6. Objects facing…
How to make “Friend Follows Player” in Unity Game Development
This is a video tutorial showing you how to make a friendly object/character that will follow the player object anywhere it goes. For example in this game I have FPS character controller, and wherever I go I can make that friendly object walks following me (the player). This is the script that I used in…
Tutorial how to make rocket launcher shooting game in Unity
Hi, in this blog post I will start a tutorial series about how to make rocket launcher shooting game in Unity. I already have the game ready. It is a FPS game with Skibidi Toilet monsters around and we need to escape and run away from them. But it would be more interesting if we…
Useful and free light flares for your Unity game development
I have some lens flare files that I usually use and I forgot where did I get it, I believe I got it from internet. So I return it back to internet so you guys can use it too. Here is the link I stored it in my drive: https://drive.google.com/file/d/10oPol_griAe3sidhDPV0xuTcnNKQwjrt/view?usp=share_link
Simple Example to begin with Photon PUN multiplayer game development
This simple script is to connect the game to Photon server and instantiate a player prefab on your Resources folder. Make sure your player prefab has PhotonView component in it. Check out this video on how to use it: Ready to develop more? Watch out the next steps of what we can do with Photon…
Super Silly Simple Unity FPS WASD player movement script
In case you need a simple script to move your game character using WASD buttons, feel free to use it: