Category: Physics

Generating Hit Events

Unreal Engine 4 provides an easy way to generate Hit Events. We have two different types of Hit Events:

OnHit event, which……

Generating Overlap Events

In Unreal Engine 4 provides an easy way to generated overlap events. Overlap events consist of BeginOverlap and EndOverlap. In this tutorial I’m going to create a custom trigger that uses both functions.

Creating a Custom Trigger Box

In order to create a custom trigger box add a new C++ class which inherits from the TriggerBox class…….

Adding Radial Impulse to Actors

One can best describe the Radial Impulse as a bomb explosion, emitting force from it’s core to all nearby objects.

Creating the necessary parameters of the “Bomb” Actor

Create a class which inherits from Actor. To create a Radial Impulse we need:

The origin of the impulse
The radius of the impulse
The strength of the impulse
The impulse fall off distance (this……

Adding Impulse to an Actor

The difference between the Force and Impulse is that Impulse is recommended for one time instant burst. To apply an impulse to an Actor, follow up this tutorial but in the logic of the MoveChosenActor type in the following code:

PS: I’m aware of the fact that we are not adding a force in this case,……

Adding Force to an Actor

Sometimes, we need to apply a force to an Actor. The force we apply is like a “thruster”. It’s good for adding a burst over some (non zero) time and it should be called every frame for the duration of the force. In order to apply a force you need a Primitive Component.

In this tutorial however, I won’t……

Tracing multiple objects

In this tutorial I’m going to create a trace for multiple objects. While Unreal Engine provides a set of different shapes that developers can use in this post I’m going to create a sphere. Here is the end result of the tutorial:

Single Line Raycasting

Raycasting is a special collision technique in which you emit a single ray (in this case at least!), with fixed length, origin and direction that has a Hit Result which contains information about the Object or Actor that the ray collided with.

For this post, I’m going to use a FirstPerson C++ Template. I will create……