Source Code | Playground
Mousecast Plus is a versatile module that simplifies 3D mouse detection with raycasting. It provides seamless functionality through onHoverEnter, onHoverLeave, and onClick events, enabling intuitive interactions with 3D objects. Designed for compatibility across all platforms, Mousecast Plus makes implementing advanced mouse interactions effortless.
📖Tutorial/Documentation
How to require MouseCastPlus
local MouseCastPlus = require(game.ReplicatedStorage.MouseCastPlus) -- where you keep mousecastplus
How To Use
MouseCastPlus.new({table})
Function that creates a new table of parts to do the effect on.
local hoverObjects = MouseCastPlus.new({ Basepart, Basepart }, Maxactivationdisatance) -- in the table is where you will put all of the parts, you can have one or more parts in this table. For maxactivationdistance you can leave it blank for infinite distance, or a number such as 20 studs away.
hoverObject:onHoverEnter(function(part)
hoverObject:onHoverEnter(function(part)
-- what you want to happen when mouse enters/hovers
end)
hoverObject:onHoverLeave(function(part)
hoverObject:onHoverLeave(function(part)
-- what you want to happen when the mouse leaves
end)
hoverObject:onClick(function(part)
hoverObject:onClick(function(part)
-- what you want to happen when the player clicks on the part
end)
Showcases
Hover Example
Door System
Credits
@JJsStuff_1 → Created the system and dev-forum
@ForeverHD → When uploading this dev-forum post, I used his Zone-Plus post as reference for how I should format this.
Final
MouseCast Plus is free and open source. If you have any questions or suggestions I am all ears or I guess eyes
You are welcome to use and modify this module for any of your projects, credits would be greatly appreciated but not required
Please do not reupload this module unless you made changes and its not a virus.
That is the module, thank you