Stuck While Implementing Odd Cursor Tracking


I’m working on a system to replicate the behavior of one of my favorite games, Movie Battles 2. In MB2, your cursor doesn’t always remain in the center of the screen(you’re basically mouse locked for usual gameplay in MB2), but interacts with game objects.

I’m not quite sure what they did to accomplish this, and in my own testing, using a function convert the world position of Mouse.Hit to a screen position didn’t quite yield the results I was looking for, seen here:

Given that this doesn’t work as intended, I’m guessing maybe that MB2 somehow factors in the look vector of a player’s character and works that in with it’s final Mouse.Hit position? I’m not quite sure. If anyone has any ideas on how to replicate this, I’d love to hear them!