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

Avoid hitting test on invalid positions #227

Closed
davyzhang opened this issue Jun 6, 2024 · 5 comments
Closed

Avoid hitting test on invalid positions #227

davyzhang opened this issue Jun 6, 2024 · 5 comments

Comments

@davyzhang
Copy link

Screen position out of view frustum (screen pos -nan(ind), -nan(ind), 0.000000) (Camera rect 0 0 1536 2048)

PR:
#226

@xiaoguzhu
Copy link
Member

the pos comes from Input.mousePosition or Mouse.current.position.ReadValue(), I've never come across a situation where they weren't numbers or were infinite, can you explain?

@davyzhang
Copy link
Author

davyzhang commented Jun 11, 2024

unity 版本
2022.3.30f1.git.7361922
Revision: 2022.3/staging 70558241b701
Built: Tue, 14 May 2024 21:12:45 GMT

其实就是样例场景, 我把我加的那几行注释掉了就会不停的报错
Example 01 / Example 03 都可以重现

image
image

问题可能出在这一行

image

没有用新的inputSystem 这里拿到的确实是nan

@davyzhang
Copy link
Author

davyzhang commented Jun 11, 2024

如果我用了新的input system, 按钮点击又会全部失效, 所有按钮都不能点击了

image

这个地方在new input system下面一直都是0
image

@xiaoguzhu
Copy link
Member

在网上没有找到资料说明在什么情况下Input.mousePosition出现infinite的值,我自己也没能重现,也没见其他人反馈过。你试试换个unity版本,看看是不是特定Unity版本的bug。

@davyzhang
Copy link
Author

那我先close把, 你后面再观察一下

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

No branches or pull requests

2 participants