Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method OnPointerClick only triggers when pad is being held down #48

Open
munro-riley opened this issue Jul 18, 2018 · 2 comments
Open
Labels

Comments

@munro-riley
Copy link

For our project we have the basic teleport script added and working based off of the pad button. We also wrote a simple OnPointerClick script that just sends a message to the console and attached to a mesh.

using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems; 
using UnityEngine;
using UnityEngine; using HTC.UnityPlugin.Vive; 
using UnityEngine.UI;

public class Marker : MonoBehaviour , IPointerClickHandler {
        public void OnPointerClick(PointerEventData eventData) {
		if (eventData.IsViveButton(ControllerButton.Trigger)) {
			Debug.Log("worked");
		}
	}
}

The console only logs 'worked' when I'm holding the pad down as well as the trigger. It doesn't work on trigger only like it should.

@lawwong
Copy link
Contributor

lawwong commented Jul 31, 2018

I assumed that you worked on the teleport scene?

In the ViveCurvePointers prefab, the curved pointer only enabled when trackpad button help down.
This is controlled by ViveInputVirtualButton script, remove it and enable the pointer then it should stay appeared.

(Notice that pointer doesn't send any messages when it is disabled)

You can try adding your test script to the UIButton in example 0, and it should work as you expected.

BTW, send your scene if it is not the case I thought~

@munro-riley
Copy link
Author

Solved, we ended up just writing our own controller manager based on the sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants