0
Answered

Hello, can you show some example how to fire from...

Петр Барышевский 2 weeks ago in Shooter updated by Marti (Lead Developer) 2 weeks ago 1

hello, can you show some example how to fire from aiming state and then zoom weapon and fire through the fly of the weapon?

Unity version:
Game Creator version:

Answer

Answer
Answered

I've created a new topic from your question. Please make sure to create separate topics for each questions. This will help us keep things organized.


Regarding your question, it's quite easy! For example, imagine you want to zoom in using the O key and zoom out using the L key (you can later customize these with the keys you want). All you need to do is change the Field of View of the camera to simulate the zoom in/out.

To do so, simply create a Trigger On Key Down with the O option selected. Make it call the Action "Camera FOV". FOV means Field of View.

The default Field of View is 60. Changing it to 30 means it will squeeze the scene elements to fit inside your frustum. This means that everything appears closer, but you loose the sense of depth. This is exactly how lenses work.

So to zoom in, use the Action Camera FOV with a value of 30, and to zoom out, a value of 60. Hope this helps!

GOOD, I'M SATISFIED

Thanks, guys. I did 2 aiming modes with 2 camera motors. The first is when the player is running, the second is when he goes into walking mode. The first - when the player enters the aiming state - I allowed him to run in this mode and increased the scatter of the sight. By the "Q" button, I change the camera motor, where the Z axis is a zoomed, force player to walking mode, make aiming more accurate. When I press Q again - it returns to main camera motor... Next I press RMB and Player goes out from aiming. Great module, great game engine. Waiting for answer about quick weapon change from inventory slot.

Satisfaction mark by Петр Барышевский 2 weeks ago
Answer
Answered

I've created a new topic from your question. Please make sure to create separate topics for each questions. This will help us keep things organized.


Regarding your question, it's quite easy! For example, imagine you want to zoom in using the O key and zoom out using the L key (you can later customize these with the keys you want). All you need to do is change the Field of View of the camera to simulate the zoom in/out.

To do so, simply create a Trigger On Key Down with the O option selected. Make it call the Action "Camera FOV". FOV means Field of View.

The default Field of View is 60. Changing it to 30 means it will squeeze the scene elements to fit inside your frustum. This means that everything appears closer, but you loose the sense of depth. This is exactly how lenses work.

So to zoom in, use the Action Camera FOV with a value of 30, and to zoom out, a value of 60. Hope this helps!