Solution for using multiple cameras with center of camera being your aim point

This only applies to people who are using the center of the camera/screen as their aim point for the projectile “Forward Vector”.

I know in an earlier video there’s a condition to check if the player is aiming before letting them fire the weapon. However, if for some reason you wanted to allow firing the weapon even when not aiming (i.e. hip firing the weapon) and still continue using the center of the screen/camera I figured it would be problematic since there are multiple cameras.

Well I found a solution and just wanted to share. Not sure it’s the best approach, but it was simple and I felt good about the fact that my solution worked on the first try. :slight_smile:

On the player character blueprint I first set up a boolean variable that tracks whether the ADSCamera is enabled or not.

My next challenge was to figure out how to get the world location and forward vector of the active camera. This is where I found out about the ‘Select’ node.

This node takes two inputs/parameters, a true and a false. It also takes in a condition, in this case I used the boolean variable I created above that tracks whether the ADSCamera is active or not. And depending on the condition, it’ll use the information from the selected input (i.e. the ADSCamera or the FollowCamera).

So now whatever camera is active has its world location and forward vector information used when the player fires the weapon. Now when the player clicks the ‘fire weapon’ button you could disable the conditional check to see whether they are aiming, it would always fire towards the center of the whatever active camera is set.

Privacy & Terms