playMaker

Author Topic: Getting input from scroll wheel[SOLVED]  (Read 2455 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
    • View Profile
Getting input from scroll wheel[SOLVED]
« on: January 15, 2016, 12:54:50 AM »
Sure this is simple, just can't figure it out, but how do I get input from my the scrollwheel (for zooming camera in and out of 3rd person view)
I get how to connect it to my player controller value, but literally, I canĀ“t find and action that explicitly mentions the scroll wheel. Is there some input action, or mouse action I need to install?
« Last Edit: April 16, 2019, 10:29:18 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14564
  • Official Playmaker Support
    • View Profile
Re: Getting input from scroll wheel
« Reply #1 on: January 15, 2016, 01:39:08 AM »
Hi,

 it's simply because the scrollwheel is handled like any other Unity input, via the Unity Input settings.

there is in there a pre built input called "Mouse ScrollWheel"

 so use the regular input actions such as "get Axis" pointing to that "Mouse ScrollWheel" input reference and you are good to go.

 Bye,

 Jean

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
    • View Profile
Re: Getting input from scroll wheel
« Reply #2 on: January 15, 2016, 02:59:36 AM »
Thanks Jean, that worked a charm... new issue however is that after scrolling the value changes on the camera y value (accessed by dragging the component into PlayMaker, selecting Set Property, and linking my Get axis Mouse scroll wheel var to it) however, the value jumps back to the default afterwards... wo although it does zoom a bit, it pops straight back to the normal position.. (and is a tad jerky, no doubt due to the same issue).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14564
  • Official Playmaker Support
    • View Profile
Re: Getting input from scroll wheel
« Reply #3 on: January 15, 2016, 03:36:25 AM »
Hi,

 Inputs do not adds up, so if you are using the scrollwheel for translating, make sure you increment instead of using the absolute value.

value = value + mousewheel

instead of value = mousewheel

Bye,

 Jean

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
    • View Profile
Re: Getting input from scroll wheel
« Reply #4 on: January 15, 2016, 04:01:35 AM »
Yeah... of course.. geddit... Thanks

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
    • View Profile
Re: Getting input from scroll wheel
« Reply #5 on: January 19, 2016, 08:37:59 AM »
Arghhh.. Sorry Jean, I thought I could figure out how to do this...
I know I have to do something like:
Get Axis >store that as MouseScroll
Multiply the axis by a value>store that
Use that to move the camera translation
and Store the result BACK to MouseScroll

but I cant find the right combination of actions or variables...
right now Im just stacking them in a row, do I need to transition them or something?

M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14564
  • Official Playmaker Support
    • View Profile
Re: Getting input from scroll wheel
« Reply #6 on: August 10, 2016, 05:10:10 AM »
Hi,

 Have you been able to figure this out?

 Bye,

 Jean

EnginKoc

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Getting input from scroll wheel
« Reply #7 on: April 16, 2019, 06:35:28 AM »
Hello,
It's been a long time for this issue but I Wanted to tell Icould use the MouseWheel axis very easily to set the Y component of camera and zoom according to that. I used the GetAxis to get the mousewheel float and then translate the camera on the Y axis according to that float.