Any ideas on how raycasting could be done in a manner to detect objects within a ViewportFrame? Obviously, simply trying to cast a ray won’t work, because raycasting only affects objects in the workspace. So the solution will have to be pretty clever. Has anyone tried to do this? Any ideas?
For context: I’m trying to detect when the mouse is over an object in a viewport frame, but I want it to be much more precise than simply detecting the mouse over the frame itself.
There is a WorldModel object coming out that will have the functionality of the Workspace but viewport frames inherit from it, which means they get animation in raycasting. If you need the functionality now, I know Onogork has a solution you can check out: https://twitter.com/Onogork/status/1212072745263095816?s=20
Looks like his module is creating a clone of the viewport object and putting it into the actual workspace at the same position (but transparent/non-cancollide). It’s a pretty good workaround for this. I might use it for now.
@Nezuo I had never heard of the WorldModel object. Sounds really cool. That will be the ideal solution.
Look at the last improvement on these release notes. Here is the API that @Maximum_ADHD showed on twitter. You can see it just moves workspace’s functionality into the WorldModel class. Workspace and ViewportFrames will inherit from this WorldModel.