Skip to content

[Help needed] Using Camera.main.ScreenToWorldPoint() with a render texture #9

@oultrox

Description

@oultrox

Hello there!

Thanks for making this amazing framework for generating the pixel-perfect render but I'm facing some trouble regards a crosshair I have for, say, top-down shooter-ish.

Camera.main.ScreenToWorldPoint() works perfectly when I don't use a target render texture but in all my tests the crosshair doesn't follow the cursor properly. I discovered that if I use in playmode the same exact same of the display size, there it works so I'm sure it has something to do with the scaling the screen where I display.

Here's how I do the crosshair script to follow the mouse.
image

And yeah...
With PixelCamera2D Enabled
image
Imagine the red arrow is actually the mouse pointer.

With PixelCamera2D Disabled
image

Hopefully you can help me! Thanks in advance to anyone who knows how to solve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions