- Home /
How to get PointerEventDatas[]?
I'm trying to go all touches and print the touch positions. This is what I have so far. It's only working for the actual (only one) touch. Not all touches. How can I change this to all touches?
foreach (Touch touch in Input.touches) {
PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
eventDataCurrentPosition.position = touch.position;
print(eventDataCurrentPosition.position);
}
Comment
Your answer
Follow this Question
Related Questions
Check UI panel touched after OnEnable()? 0 Answers
How to deal with many buttons in the Inspector 1 Answer
Unity 2021 LTS: IPointerEnterHandler is broken 1 Answer
Can't interact with buttons in a UI Canvas in World Space Render Mode. 0 Answers
Detect canvas object under mouse because only some canvases should block mouse. 2 Answers