Yes you have to add the else in after the logic on raycastResult otherwise the cursor will not fallback to default.
thank you very much! I did some testing after you said that and I think i finally figured it out. I’m at that point in coding stuff and I’m just starting to knock out some basic logic stuff and I’m a little slow. thank you very much this was very helpful!
No problem, you are welcome, I’m glad it helped you in some way. I didn’t see your edit on the original question about the frame rate drop so I am just scratching my head with that now. I’ve tried a few logic attempts, and have just tried a timer hack (like only cast every 1/5th of a second) but this is not an ideal solution. You might have to check whether a target is already selected (store this on selection) and cast the corner points of a Region3 back to the viewport and store these points. Then you can just check the mouse position every frame until it falls out of this boundary rather than raycasting the whole time the pointer is within the target. I cant see a frame drop in the Summary Stats window, how are you seeing the frame rate drop?
so i only found there to be lag in the original rbxl file you sent, when I would try my best to only hover over the blue square from a distance and move around, I found there to be a small fps drop. you could replicate it by walking about 20 studs away, zooming another 20 studs out and aim training onto the block, for example i tested the blue one. It is pretty insignificant but in the new version I was unable to notice any change.
If any of the examples solved this for you please choose a solution and close the topic.