generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: detecting scrolling?

Previous Thread :: Next Thread 
PvN is not online. PvN
Joined: 10 Apr 2010
Total Posts: 22145
27 May 2015 08:41 PM
MouseWheelForward doesnt return anything and neither does UserInputService

is there a way to detect scrolling? cant find many threads talking about it
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:44 PM
local UIS = game:GetService("UserInputService")

function mouseScrolled(inputObject, gameProcessedEvent)
if inputObject.UserInputType == Enum.UserInputType.MouseWheel then
if inputObject.Position == 1 then
-- moved forward
elseif inputObject.Position == -1 then
-- moved backward
else
-- didn't move
end
end
end

UIS.InputChanged:connect(mouseScrolled)
Report Abuse
oofive2 is not online. oofive2
Joined: 08 May 2011
Total Posts: 1608
27 May 2015 08:45 PM
script.Parent.MouseButton1Click:connect(function()
--code
end)

You can make it so when they click on the frame it will act up if you want.

-/I can't drown my demons they know how to swim\-
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:45 PM
^
that's defiantly the same thing as scrolling.
Report Abuse
oofive2 is not online. oofive2
Joined: 08 May 2011
Total Posts: 1608
27 May 2015 08:45 PM
You can also make an invisible frame near the scroll bar that does nothing besides make a plant for the click c:. No need to be complicated when you can be creative :D.


-/I can't drown my demons they know how to swim\-
Report Abuse
oofive2 is not online. oofive2
Joined: 08 May 2011
Total Posts: 1608
27 May 2015 08:46 PM
nQ dont hate that im more creative than you c:.


-/I can't drown my demons they know how to swim\-
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:46 PM
^
that is complicated. the way I posted is extremely simple.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
27 May 2015 08:49 PM
"else
-- didn't move"

Hopefully that code never runs.
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:50 PM
That would be pretty scary.
Report Abuse
PvN is not online. PvN
Joined: 10 Apr 2010
Total Posts: 22145
27 May 2015 08:52 PM
have you used that before? it doesnt work

local UIS = game:GetService("UserInputService")

function mouseScrolled(inputObject, gameProcessedEvent)
if inputObject.UserInputType == Enum.UserInputType.MouseWheel then
if inputObject.Position == 1 then
print("moved forward")
elseif inputObject.Position == -1 then
print("moved backward")
else
print("didn't move")
end
end
end

UIS.InputChanged:connect(mouseScrolled)


oh well i just wont bother
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:54 PM
Sorry, I was wrong :(

local UIS = game:GetService("UserInputService")

function mouseScrolled(inputObject, gameProcessedEvent)
if inputObject.UserInputType == Enum.UserInputType.MouseWheel then
if inputObject.Position.Z > 0 then
-- moved forward
else
-- moved backward
end
end
end

UIS.InputChanged:connect(mouseScrolled)


Also, the Z position should indicate how much the player scrolled, and I don't know what the other components of the vector3 represent.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
27 May 2015 08:57 PM
are you able to define a specific player with UIS?
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
27 May 2015 08:58 PM
UserInputService is local.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
27 May 2015 09:15 PM
The first two components of the Position Vector3 correspond to the mouse's position on the screen.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image