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 Jep · Oct 24, 2012 at 08:46 PM · eventmouseposition

Event.current.mousePosition only updates on mouse stop?

Hi, I'm making a custom editor script in which I have something following the mouse. I noticed that as long as I'm moving the mouse, the mousePosition event does not update, but when I stop moving the mouse it does which makes my gui object jump in position.

What would you recommend I use to get the mouse position more frequently?

Comment
Add comment · Show 3
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 Lukas_GMC · Sep 07, 2013 at 09:04 PM 0
Share

If you figured this out could you post your answer please?

avatar image EHogger · Sep 07, 2013 at 09:14 PM 0
Share

Couldn't you just use Input.mousePosition?

avatar image Lukas_GMC · Sep 09, 2013 at 08:51 PM 1
Share

Input.mousePosition only works at runtime.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Sep 08, 2013 at 09:43 AM

If you want to use the MouseMove event you have to set EditorWindow.wantsMouseMove to true. Keep in mind that events are sent to the active window. For example a SceneViewWindow has it's own events which can be processed in a cursom editors OnSceneGUI callback or with SceneView.onSceneGUIDelegate.

Comment
Add comment · Show 2 · Share
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 Lukas_GMC · Sep 09, 2013 at 10:22 PM 0
Share

I can't get $$anonymous$$e to work. I've tried:

 SceneView.currentDrawingSceneView.wants$$anonymous$$ouse$$anonymous$$ove = true;

and

 ((SceneView)SceneView.sceneViews[0]).wants$$anonymous$$ouse$$anonymous$$ove = true;

Neither of them make any difference for mouse movement.

avatar image Bunny83 · Sep 09, 2013 at 11:07 PM 0
Share

@Lukas_G$$anonymous$$C:
Sceneviews already have wants$$anonymous$$ouse$$anonymous$$ove set to true and the $$anonymous$$ouse$$anonymous$$ove event is sent properly to all event handlers which processes sceneview events (either the onSceneGUIDelegate or OnSceneGUI). All other Editor windows have it's own wants$$anonymous$$ouse$$anonymous$$ove variable.

Custom editors (inspectors) don't have the $$anonymous$$ouse$$anonymous$$ove event, only the usual $$anonymous$$ouseDown, $$anonymous$$ouseDrag, $$anonymous$$ouseUp events. $$anonymous$$eep in $$anonymous$$d that controls will "eat" events when they process it. This will change the eventtype to "used" so that no other control can process it.

Without more details about where you want to process which events it's pointless to go any further here. You should post a seperate question.

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

14 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

Related Questions

Changing SpriteRenderer color with UnityEvent.Event 1 Answer

How to change a Player direction by colliding a Game Object 1 Answer

IPointerClickHandler works until I add IPointerDownHandler 0 Answers

How to create an in game search engine? And how to select the searched object? 0 Answers

Dynamic skill system with scriptable objects 2 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