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 tatjanamaskaljunas · Sep 18, 2018 at 09:42 PM · objectbehavior

Leap Motion and SMI eye tracking on Objects

alt textHey guys, I need some help with Leap Motion and SMI eytracking in Unity. We are trying to combine Leap Motion and SMI Eye tracking, such that both work on one object. When gazing on the object and, e.g. changing color, one should be able to grasp the object. However If you call the InteractionBehavior Script as a function in the "Gazing" Script (change color if gaze is on object) it does not work, nor the color change. If the InteractionBehavior and Gaze Components are both applied as Behavior Components to an object, then only the grasping functions and the object does not change the color when gazing at it.
My problem is to identify what part is not working, two behavior components (SMI and Leap Motion) or just the color change part in the Gaze Script. It's quite difficult to explain but maybe someone have some experience with those two devices. Thanks in Advance!!

screenshot-57.png (93.6 kB)
Comment
Add comment · Show 1
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 tatjanamaskaljunas · Sep 18, 2018 at 09:46 PM 0
Share
 Just the important parts of the "Gaze" Script to change the color/ material.
 
 namespace S$$anonymous$$I
 {
     [AddComponent$$anonymous$$enu("")]
     [RequireComponent(typeof(InteractionBehaviour))]
     public class GazeAction : Gaze$$anonymous$$onoBehaviour
     {
 public virtual void Start()
         {
             //Default material is stored to change the object material in OnGazeEnter.
             meshrenderer = GetComponent<$$anonymous$$eshRenderer>();
             if (meshrenderer != null)
             {
                 default$$anonymous$$aterial = meshrenderer.material;
             }
         }
 
         // Update is called once per frame
         public virtual void Update()
         {
 
         }
 
 
         private InteractionBehaviour _intObj;
         public override void OnGazeEnter(RaycastHit hitInformation)
         {
             //If this game object has a parent GazeAction object, its OnGazeEnter must be called.
             if (gazeParent != null)
             {
                 gazeParent.OnGazeEnter(hitInformation);
             }
            
             
             // Script InteractionBehaviour soll als Feld _intObj aufgerufen werden 
             
             isGazed = true;
 
             //////////////////////////////////////////////////////////////
             //Change material while the player gazes at the object.
             // Interact when gaze is on Object
             if (gaze$$anonymous$$aterial != null && meshrenderer != null)
             {
                 // InteractionBehaviour erlauben nur wenn EyeGaze auf Object ist
                 _intObj = GetComponent<InteractionBehaviour>();
                    
                 //transform.Rotate(new Vector3(0, 30, 0));
                 meshrenderer.material = gaze$$anonymous$$aterial;
             }

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

155 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

Related Questions

Cannot convert 'object' expression to 'float' 1 Answer

C# Find specific object by getting one of its variables 0 Answers

C# Limit touch movement on a raycast 2 Answers

2D - Object follow cursor on X-axis. 0 Answers

Cant find text objects after being renamed. 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