Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by rodrigo_bruno · Oct 21, 2016 at 02:29 PM · c#unity 5editorinput

Is the Input System not working properly? (OSX Unity Editor 5.4.1)

So, I've tried with several methods of Input Class, and any of them seems to lose a held button after a couple of time. I've been searching for something that explains that on my project/scene but have found nothing.

Symple putting Input.anyKey or Input.GetMouseButton(0) or something like that (as the first one already negates the others), on an Update() will show the problem.

 void Update() {
         if (Input.anyKey) {
             print("Button being held");
         }
 }
 //Will print only for a couple of seconds only.
 //The object holding the script is not being deactivated(prints false outside the if statement).

I just want to capture the mouse being held down for a long time, dragging some objects(and I want using the Input System, because I'll then switch to touch events), but after 1 ~ 5 seconds the event just loses the button, and keeps returning false, even the Input.GetMouseButtonUp(0) event (for example) is not called after that.

Is anyone also having this problem?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Atair · Nov 12, 2016 at 11:39 AM

@rodrigo_bruno

Just had the same problem (osx, normal mouse, but magic trackpad).

Anyway - the Solution:

Edit > Project Settings > Editor: Turn off the Unity Remote

Now the mouse works fine (at least for me)

Comment
Add comment · Show 1 · 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 rodrigo_bruno · Nov 22, 2016 at 06:55 PM 0
Share

Apparently that was the problem for me too... After a few hours going crazy by creating test scenes and comparing to the main scene, the problem was gone I couldn't figure out what was causing it. Then I saw your answer and I realized and I was using Unity Remote at the time.

avatar image
0

Answer by Landern · Oct 26, 2016 at 01:13 PM

I'm using a real mouse(no magic mouse business, nor track pad or anything like that) and i can't reproduce your issue.

The script i used to test without anything super complicated, just a clean scene, empty gameobject with the below script attached. Attached is also a screen shot of the Unity Editor console.

 using UnityEngine;
 
 public class Test : MonoBehaviour
 {
     float heldTime = 0.0f;
 
     // Update is called once per frame
     void Update()
     {
         if (Input.GetMouseButton(0))
         {
             heldTime += Time.deltaTime;
         }
 
         if (Input.GetMouseButtonUp(0))
         {
             Debug.Log("Mouse Released, resetting held time to 0.0f.");
             heldTime = 0.0f;
         }
 
         Debug.Log("Mouse Held For: " + heldTime.ToString() + " Seconds");
     }
 }

Unity Editor Console Log

If something as simple as this isn't working, i would check out the implementation or the mouse/device drivers. Maybe use another device. Also perhaps something something else is running that might capture the mouse down event at a system level and reset it. Just some thoughts.


mouseheld.png (25.2 kB)
Comment
Add comment · 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

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

265 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 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 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 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

How to take user input, convert it integer, and print it on screen? 1 Answer

Unity physics Help Implementing Real Life Physics in Jumping System C# 2 Answers

Make a 3D Object look like hes facing a point in an 2D space 0 Answers

How To Attach a Number To a Variable Which Is Got From User 1 Answer

Button disappearing when I start playmode 1 Answer


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