Public vs Private Fields (Unity Tip) @KetraGames
Public vs Private Fields (Unity Tip)  @KetraGames
Uploaded October 2020 | Updated September 2026, 2 weeks ago
In this Unity quick tip we're going to look at how we can have private fields that can be set through the inspector.

If you prefer written instructions you can find a link to the text version here - ketra-games.com/2020/08/unity-game-tutorial-setting-private-fields-through-the-inspector.html.

Public Fields vs Private Fields in Unity

It's generally good practice to make fields private if we don't want them to be changed from other scripts, but doing this means they aren’t available to be set from the Inspector. In this tutorial we're going to look at how we can have the best of both worlds and have private fields that can be set through the inspector.
Public vs Private Fields (Unity Tip)Simple AI Obstacle Avoidance in UnityCreating Simple Enemy AI to Chase the Player (Unity Tutorial | 2D Top Down Shooter)A Beginner Level Introduction to Prefabs (Unity Tutorial | 2D Top Down Shooter)Positioning Objects using Vertex Snapping (Unity Tip)Root Motion Explained (Unity Tutorial)Recentre the Camera on Key/Trigger Press Using Cinemachine (Unity Tutorial)Reuse Images at Different Sizes Using 9 Slicing (Unity Tutorial)How to Make the Camera Follow the Player Using Cinemachine (Unity Tutorial)Creating an Infinite Bouncing Ball with Physic Materials (Unity Tutorial)Setting the Value of a Property in the Inspector (Unity Tutorial)How to Procedurally Generate a Perfect Maze (Unity Tutorial)
Ketra Games |

Public vs Private Fields (Unity Tip)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER