简体   繁体   English

如何使用新的输入系统在 Unity 中找到鼠标 position

[英]How to find the mouse position in Unity using the New Input System

How can I find the mouse position in Unity?如何在 Unity 中找到鼠标 position? I am using the new Input System and I've already tried我正在使用新的输入系统,我已经尝试过

InputDevice mouse = Mouse.current;

Ray ray = camera.ScreenPointToRay(mouse.position);

, but it didn't work. ,但它没有用。 Anyone?任何人?

use this:用这个:

Ray ray = camera.ScreenPointToRay(Mouse.current.position.ReadValue());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM