One of the most important concepts regarding energy is that it's a property of objects that can be transferred from one object to another, but it cannot be created or destroyed. All forms of energy follow the conservation of energy aspect and can be converted to different types of energy. There are many types of energy that exist in the real world. Here are a few examples:
These are just a few examples of energy that exist in the real world, so feel free to perform additional research on the concept of energy because this section will only cover the surface of the topic. When it comes to the concept of energy and the conservation of energy, Unreal Engine 4 follows these properties as well through its built-in physics engine.
As discussed in the previous section of this chapter regarding the Newtonian principles, forces are any interaction that tends to change the motion of an object. This can also be referred to as concepts (such as pushing and pulling) and contains a magnitude and direction, making it a vector quantity. Forces can be caused by gravity, magnetism, wind, or even the pushing or pulling of an object by a person or machine.
In Unreal Engine 4, we can add forces through blueprint scripting, and we can perform this in a few ways. The first method is a function called Add Force. This acts a lot like a thruster and adds a linear burst of energy in the specified direction.
You can add this type of force to any component associated with our blueprint, or you can apply this force to any component that is hit by a component of our blueprint. We can also see that there is a bone name property in this function. This means that we can apply force to a bone if one exists in our blueprint.
The second method of applying forces to our blueprint components or to components in our game world is through the Add Radial Force function:
This function allows you to specify a location in the 3D space. Here, the source of the radial force begins and then specifies a radius and strength using Float values. Lastly, we can apply one of the two methods of Falloff for the radius, which is either a constant fall-off or a linear fall-off. All bodies in this radius will be affected by this force, so make sure that you take this into consideration when you apply radius and strength values.