playMaker

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

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Getting input from scroll wheel[SOLVED]
« on: January 15, 2016, 02: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 17, 2019, 01:29:18 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Getting input from scroll wheel
« Reply #1 on: January 15, 2016, 03: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
Re: Getting input from scroll wheel
« Reply #2 on: January 15, 2016, 04: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: 15500
  • Official Playmaker Support
Re: Getting input from scroll wheel
« Reply #3 on: January 15, 2016, 05: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
Re: Getting input from scroll wheel
« Reply #4 on: January 15, 2016, 06:01:35 AM »
Yeah... of course.. geddit... Thanks

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Getting input from scroll wheel
« Reply #5 on: January 19, 2016, 10: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: 15500
  • Official Playmaker Support
Re: Getting input from scroll wheel
« Reply #6 on: August 10, 2016, 08:10:10 AM »
Hi,

 Have you been able to figure this out?

 Bye,

 Jean

EnginKoc

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Getting input from scroll wheel
« Reply #7 on: April 16, 2019, 09: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.