When designing levels or trying to get a distance value to provide to a Blueprint property, it’s helpful to get an approximate distance quickly from within the scene. Today I want to show you how to do that quickly, and even tell UE the units you want to work with.
Measuring Distance in Scene
For example, if I’m placing enemies on a level and want to check how far apart they are. First, I’ll open the four-panel layout, and by pressing down on the middle-mouse wheel and dragging on the top view, I can see they are about 200cm apart.
By default, UE 5 is set to use centimeters, but what if I want to measure by meters instead? Luckily, we can change this in Editor Preferences.
Open Editor Preferences -> Level Editor-> Viewports and find Measuring Tool Units. Here, you can change the measurement units used by tools to Centimeters, Meters, or Kilometers.
I’ll switch to Meters and now let’s use the distance measurement tool once again to see the updated unit value being used.
This measurement tool can be quite helpful when finding a distance for programmatic actions and level design. For instance, I use this when considering AI behavior based on the player distance to get an idea of how close or far away objects in the scene should be before behaviors change.