Player Aim Down Sights


Johncarlos Lillo

3/8/2024

The Problem: ADS - 
For the past two weeks, I've have been trying to get down the Aim Down Sights, which has been a struggle for me personally. Some of the first issues I was having with ADS is that the Camera Boom was not relative to the player, but instead it was Relative to the world. Due to this, the Player's camera would go to a completely different area when Aiming Down Sights, and Permanetly staying there since it thought that was the Camera Booms default location.

Camera Boom Staying at ADS Location:


Furthermore, I was also having issues with the gun clipping into the Players Camera. Since the gun is a Skeletal Mesh, it clips through the mesh and the player is able to see the inside of the gun.

The Solution: ADS-

I was able to find a solution in order to get the actual location of the camera. Though its a bandaid fix, I was able to get the Camera Boom, and cast it to a String. Afterwards, I had it print its location On Event Begin Play, so it could give me the REAL location of the Camera Boom. Afterwards, I set the camera booms actual location to the ADS, and it was able to work. The Picture below depicts the fix. The Red Circle being the Default Location of the Camera Boom (Hip Fire), and the Blue Circle being the ADS Location for when the player aims down sights:


Afterwards, It was all about fixing the Camera Clipping into the gun when the player Aim's down sights (Near Clip Plane). I was able to achieve this by going into the Project Settings and lowering the Near Clip Plane of the player so that when things get too close to the Camera it doesnt clip through.

Here is the Near Clip Plane setting:

Now, all that there is left to do is to edit each individual gun to have nice Aim Down Sights location, and also to prevent any clipping incase the Gun Mesh is bigger or smaller.

Get Deadlands Duel: Time Rift Rumble

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

The ADS is amazing in the game!

Animation is a make or break for all games. You're doing great work so far. 

(+1)

Eso Juan!!!