Add a LookScale weapon variable for view sensitivity

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image Image

Link to Legacy Repo

QZDoom Status:
Image Image

Add a LookScale weapon variable for view sensitivity

Postby Caligari87 » Thu Mar 07, 2019 8:42 am

As it stands, adjusting the view sensitivity for a player can be done in a roundabout way by fiddling with a weapon's FOVScale and DesiredFOV to "trick" the engine into thinking the player has a higher or lower FOV than they actually do.

This pull request implements a canonical way to do the same without "hacks" by adding a simple multiplier LookScale to the weapon. For example, setting LookScale = 0.5 sets the player's look sensitivity to half.
Code: Select allExpand view
class PistolTest : Pistol {
   override void PostBeginPlay() {
      LookScale = 0.1;    //10% look sensitivity

User avatar
I'm just here for the community
User Accounts Assistant
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 1 guest