How to Convert Input.mousePosition to Raycast?

Hello, i can find mouse position with this codes:

Vector2 GetMousePosition()
{
return Camera.main.ScreenPointToRay (Input.mousePosition).origin;
}
Vector2 GetMouseDirection()
{
return getMousePosition – (Vector2)transform.position;
}

How can i convert Input.mousePosition to raycast?

There is no such thing as a mouse position to a raycast (directly).

I mean, you have ScreenPointToRay, as in your code. That can use the mouse position to create a ray, which you can use in a raycast.

This may confuse other readers, but… if this is still about your “dead zone” area, and you are still stuck, can you attach a small repo of a very simple scene with your setup? :slight_smile:
I’m sure I could help ya fix it…
Specifically, if you want the deadzone or you only wanted that because of the button/shoot interference**.

1 Like

I sent it with pm. Thank you :slight_smile: