Does anyone know how to / or can give some direction on how to do the following?
1.) Create the “zoom” of the sniper - I assume this can be done by changing the camera FOV?
2.) Create the inside of the scope - black texture over screen with centre circle visibility + crosshair?
3.) Lens on the outside to reflect light / source
Hmm I’m not really sure because I’ve never done something like that, but I think that you can change the camera position thanks to specific socket of your skeletal mesh (you can create a new one). You have simply to attach your camera to this specific socket.
Then for the zoom effect (translation of the point of view), using a Lerp would be good I think.
The inside of the scope : a simple texture with a cross inside, and the translucent part (so a square where only the dark cross have Alpha =1 (or something like that).
And for the lens, I’m sorry, but I don’t know how you can do that …
A great way to do something like this is to create two points in your character component script that will act as the zoom locations for your sniper rifle. When you press the zoom button (whatever button you choose), you can approach zooming in multiple ways, the two I personally use are:
simple set the camera to the new zoom location. This approach gives you a solid zoom that is immediate, similar to the original Halo zoom that simply locks into place.
Use a vinterp to lerp between the new zoom points, giving the illusion of adjusting a scope to the new zoom.
For the vignette and crosshairs you have a few options as well. You can create the overlay in UMG and call it when you switch to the new zoom. If you don’t want to do this, you can create a post process volume with the vignette and draw the crosshairs to the HUD using the HUD blueprint.
Thanks a lot for this input! I have used UMG to create a image, that gets called to the view port on “aim button down”. [alt text][1]
I was thinking that setting the camera to the new zoom location will allow the player to see through obstacles in his line of sight? - Say looking at a wall and pressing zoom will have the camera glitch through the wall? How would I work around this?
[1]:
If you access the camera boom in your components tab you should be able to set it to alter it’s location based on objects in the way. if you set the camera boom up like this, you can set your new camera locations to change accordingly if the boom hits a wall or an obstacle.Having said that, this may take away from a scopes realism. You could also run a trace from the camera to any object in front of it and adjust the FOV accordingly.