UE4 | How to create a fake hole in the ground that you can move it in runtime


In this tutorial we will learn how to create a fake hole in the ground, a hole that actually doesn’t exit physically in the mesh but it function as a hole !

Why we need a fake hole, why not just simply tell the 3d artist to create a hole in the mesh with proper physic collisions and we call it a hole ?

A fake hole is useful when the hole is an element of gameplay, and we want to give the level designer the freedom to put it wherever he sees it fit, depending on the requirements of the level and gameplay.

Casual Game Lighting is a material function with a collection of lighting features like fog, diffuse, ambient lighting, and specular lighting. It’s made for anyone who wants to make a beautiful and appealing casual (or hyper casual) mobile games. It will make your game looks on mobile devices exactly the same way it looks in the editor.
Marketplace Link: Click Here
Documentation and how to use it: Link

Meshes we need

What we will need:

  • Hole (cylinder) with normals inverted
  • Hole mask (Top cirecle)
  • A ring or the any object to hide hole edge

We will also need an additional mesh for collision, I will explain how we will use it later:

Hole collision: has the same shape as the hole with edge extruded

Now, export meshes and import them in unreal engine and lets make a blueprint for the hole.

Hole Blueprint

Create a blueprint BP_Hole of type Actor, and add these component:

Hole BP components

Disable collision for HoleMesh and HoleMask:

Hide HoleCollision component as we don’t need it to be visible:

Drag and drop hole blueprint in the level:

Hole blueprint is placed in the level

Now the hole is in the level, Let’s add the MAGIC !


Select HoleMaskMesh compoenent, then, in Lighting section uncheck CastShadow, expand Rendering section to uncheck Render in Main Pass and Render in Depth Pass, lastly check CustomDepth Pass:

The hole look like this now, nothing interesting yet right !?

Now we will work on the material applied to the ground.

Before changing the material, let’s explain what we did recently: We prevented the hole mask mesh from being drawn in the main pass and draw it only in a custom depth buffer:

We will use the custom depth buffer as an input mask for translucency of the ground.

Select ground material and set blend mode to Translucent, also set Lighting mode in translucency section to Surface Translucency.

Add these nodes to the material of the ground (or the surface that will have the hole):

Ground material

The result:


Some couple of things we need to do.

Select HoleCollision mesh asset and remove any collision, set Collision Complexity to “Use Complex Collision As Simple”:

Use Complex Collision As Simple

Open Project Settings > Collision: Add new object channel, name it Hole, set default response to ignore.

Add new preset with settings like in the image bellow:

When the player is in near the hole (overlap the hole sphere collision) we will change his collision preset from Pawn to Pawn_Hole, as you can see Pawn_Hole preset ignore WordStatic and WorldDynamic channels for ground, and collide with the hole object, so when player step in the hole he will fall in it !

Add the tag “HOLE” to the hole actor blueprint.

Lets add some nodes to the player blueprint.

Add these nodes to your player blueprint:

Last touch, add a new static mesh component to the hole blueprint to add a hole ring to hide the edge:

Looks nice ! Let’s test this out…


Source code


That’s all folks, I hope I didn’t miss anything ! If you have any question please leave me a comment.


Passionate game developer with +10 years of experience. Fluent in Unity3D & Unreal Engine 5. Worked as main programmer on The Dark Occult game (UE4), developed +40 games (vertical slices) and created few tools and assets for both engines. Currently helping the #gamedev community by making tools and writing tutorials at GAMEDEVWORKS.

You may also like...

140 Responses

  1. tom says:

    I really like it. A must have.
    Do you think it can also work with the “landscape”?

    • Mourad says:

      I didn’t tried it yet, but yes it’s possible, it should work, the problem is you may need to adjust the hole mesh and it’s collision shape to match landscape geometry.

  2. Isaac says:

    trying to work through this, but when I modify my material, I can see the hole, but the floor is just transparent, so it’s not actually masking, it just made the whole floor invisible. any idea what I might have done wrong?

  3. Mourad says:

    Hi Isaac. Can share some screenshots so I can see what’s happening ?

  4. DentedHawk says:

    Good, I was trying with a landscape, but when using the translucency method, everything crashes, so we would have to find a way to do it with opaque or masked

  1. September 24, 2021

    […] 制作方法チュートリアル記事はこちらUE4 | How to create a fake hole in the ground that you can move it in runtime – GamedevWorks […]

Leave a Reply

Your email address will not be published. Required fields are marked *