Search Unity

"Filtering" or "Smoothing" inputs

Discussion in 'Input System' started by LordMortis, Apr 30, 2016.

  1. LordMortis

    LordMortis

    Joined:
    Jan 25, 2014
    Posts:
    27
    Say I want to have mouse or joystick input pan a camera, but I want to smooth say, 500ms of input so that brief jerks of the mouse don't move the camera rapidly.

    So what I want is some "action" that receives the raw vector2, then emits a stream that has the smoothed values applied - what's the best way to approach this with the new system?
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The old/current input system has some smoothing options. Though things are not completely settled yet, it's likely the new system will have something similar. It doesn't yet though. Currently you can build the smoothing on top of the input yourself, as part of the gameplay code.
     
  3. LordMortis

    LordMortis

    Joined:
    Jan 25, 2014
    Posts:
    27
    Ideally what i'd like to be doing (and there are a few use cases for this) would be to take an input action and then generate another action from that - preferably via something i can put settings into (i.e. change camera input sensitivity)