A very cool game! I love the feedback and interactions. How did u get such accurate subviewport mouse clicks. I have tried a lot to make it. But somehow the mouse position and click position are far apart. Lots of love for the execution man! <3
Viewing post in Trijam Tribunal jam comments
Thanks, mate! I really appreciate you taking the time to play it and leave such a nice comment. It’s honestly really motivating to read stuff like this, so thank you! <3
And regarding your question:
I take the exact 3D hit position and convert it into local space to determine where exactly it landed on the monitor model. Since I know the physical size of the monitor mesh, I can convert that local hit position into percentages e.g. 50% from the left, 50% from the top etc. I then multiply those percentages by the actual resolution (size) of my SubViewport. After that, I take the original input event, update its position with my calculated coordinates, and send it to the SubViewport using push_input().
Hope that helps! :)