Post

Visualizzazione dei post con l'etichetta camera

Explosion effect - Camera shaking

Immagine
Every explosion has a shockwave effect, and this is usually shown in videogames with camera shaking . Unreal Engine has a built-in class that provides this kind of effect, so all we need to do is adding a new Blueprint class, and search for "Camera shake". I'll call it MyCameraShake . In the Blueprint editor we can change the parameters of the shake effect. What we need are the following: I set the duration to 0.4, so that it ends shaking just before the end of the visual explosion effect we created here . Now, in the usual EnemyBP editor, we can chain this effect to the ones already playing when we have a collision: The node to activate is "Play World Camera Shake", and we can assign it the class MyCameraShake . The location where the shake effect starts doesn't really matter, we can use the enemy location as we did for the particle system. The other 2 parameters to set are minimum radius: if the camera is placed within that radi...

Creating a custom camera

Immagine
For the purpose of this game, I don't need a camera following the player pawn, as it would do in a 3rd person game: I'm going to have a fixed camera that will show the whole game map from a static point of view. Let's see how to create it: First, go to Modes > All classes > Camera and drag a new camera into your scene. I positioned it manually, moving and rotating it until it looked at the whole map from a satisfying angle. As you can see, when it's selected, a small box on the lower  right corner of the editor shows the camera's point of view. When I'm ok with the position, I type in the round values for Location and Rotation in the camera properties: Now, what we have to do is tell Unreal that we want the game to start from that particular camera (we could have multiple cameras in our scene), and this can be done inside the Level Blueprint . With the camera selected, open the Level Blueprint. If you right-click inside th...