Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rick-grendel · Feb 06, 2015 at 08:39 AM · javascriptfloatscroll

How to get a float of the times 1 scrolled?

Hello,

I need this time a way to detect how much i scroll.

If I scroll 3 times down then scroll = -3 if i than scroll 4 times up then scroll = 1 how can i do that?

again thanks!

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mmmpies · Feb 06, 2015 at 08:44 AM 0
Share

Can you give us some more info, are you using the New 4.6 UI or OnGUI?

Also if you have some code can you post that, it'll make answering easier.

Thanks

avatar image rick-grendel · Feb 06, 2015 at 08:47 AM 0
Share

@$$anonymous$$mmpies I have no code I know to dectect scrolling but i want to know howmuch the player has scrolled down and howmuch up

avatar image Mmmpies · Feb 06, 2015 at 08:54 AM 0
Share

O$$anonymous$$ you still haven't said if you're using OnGUI or 4.6 but I'll just show you the 4.6 way.

If you have a scrollRect then you can just check the verticalNormalizedPosition (or horizontalNormalizedPosition if using horizontal scroll bars). That value is always between 0 and 1 no matter how big the content is.

 public ScrollRect myScrollRect
 
 void Update(){
 Debug.Log("scroll position = "myScrollRect.verticalNormalizedPosition);
 }

Un tested code so there may be typos!

EDIT

Sorry @rick grendel I don't think I can help you then. Converted my answer to a comment. Perhaps you could say which version you use to help people know how to answer.

avatar image rick-grendel Mmmpies · Feb 06, 2015 at 08:57 AM 0
Share

Sorry, I not use either of them. I use an old version of unity.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Javascript int to float 1 Answer

Get integer or float value of a variable 2 Answers

Error: "ArgumentException: get_deltaTime can only be called from the main thread" 1 Answer

BCE0019: 'distanceScore' is not a member of 'float'. (JavaScript) 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges