Weapon Zoom

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

muji

New Member
Mar 5, 2006
18
0
0
Hi

I've been making an M1 Garand gun for a WWII mod Uni project Im working on

When I right click, the gun comes up to iron sights by playing an "Aim" animation, but I need the FOV (Field of view / Zoom) to be set to increase when it plays this animation

Im a noob at coding, but I managed to get it to play this aim animation using this code in m1SniperRifle.uc:

Code:
simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	FireMode[1].FireAnim = 'HOLD';
}

untitled7pm.jpg


I guess I need to put in something here like newFOV = 70, but I don't know the code.... can anyone help me?

Thankyou very very much in advance
 
Last edited by a moderator:

ImediaGroup

New Member
Apr 26, 2006
12
0
0
they did something like that in the Level Design I>Console Command .... I think Camera Control VTM.

they used the code in-game... not in UnrealED/notepad/context.

I have no experience whatsoever with weapon code... I just got my 1st weapon in game today.... but this is what I would try first.
 

muji

New Member
Mar 5, 2006
18
0
0
thanks, yeah in game you can set the FOV with the command:
FOV 10
or any other such number, but the same code wont work when I try and compile it in my weapon. It just says "Error, FOV, bad command or expression"

Anyone have any idea

Thanks again
 

meowcat

take a chance
Jun 7, 2001
803
3
18
FOV is a console command, so the syntax to call it from code is more like ConsoleCommand('FOV 10"); but don't do it that way. Take a look at how the sniper rifle zoom works, the only difference is that you will not want to overide the Renderoverlays function.
 

muji

New Member
Mar 5, 2006
18
0
0
yeah actually my gun is using modified sniper rifle code - but I took out the bit where it zooms because when you hold right click it slowly zooms to a maximum that it set outside of my gun code. I just want it to go to a set FOV value everytime I right click, rather than go through a custom zoom level depending on how long I hold right click for

But thanks for your help