Results 1 to 2 of 2
  1. #1

    Default Gamepad analog values

    I need to retrieve the gamepad analog stick x/y values, but have yet to figure out how.
    According to PlayerInput.uc, it has axis variables(aBaseX, aBaseY, RawJoyUp, RawJoyRight, etc..). I have logged these values from my player controller(see following snippet), but they always show zero.
    Code:
    // I have tested this with all of the axis variables in PlayerInput.
    simulated event PlayerTick(float in_deltaTime)
    {
    	super.PlayerTick(in_deltaTime);
    	`log("Left Stick: "@PlayerInput.RawJoyUp);
    }
    If this isn't where the values are stored, where are they stored at?
    If this is where the values are stored, am I suppose to retrieve them another way?

    EDIT: Problem solved after bouncing around the engine and running some tests. I had unknowingly disabled some of the input bindings in the input configuration file while editing it, thus causing the axis variables to never change. For future reference to those that may wish to know, you can bind analog stick axes to specific variables in your PlayerInput subclass.
    For example:
    [Engine.PlayerInput]
    .Bindings=(Name="XboxTypeS_LeftX",Command="Axis AnalogLeftX Speed=1.0 DeadZone=0.2")

    This binds the x axis on the left stick of an xbox controller to a variable named AnalogLeftX in your PlayerInput class, sets the sensitivity to 1, and sets the deadzone to 0.2.
    Last edited by protocol; 09-30-2011 at 12:11 AM.

  2. #2

    Default

    After some extensive testing I've discovered that input from sources other than the gamepad changes PlayerInput.bUsingGamepad to false. I don't see how this is possible considering it's a constant, nor where it happens in the source. Where in the engine does this happen?

    EDIT: In UTConsolePlayerController there's a comment in the function AimingHelp that states "bUsingGamepad is updated every time we do an input based on what was used to make that input."
    That answers the question of where it happens, however I still don't know why the axis variables in PlayerInput are always zero.
    Last edited by protocol; 09-29-2011 at 11:09 PM.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.