Let's say my mouse hovers over a block, how do I make the size increase, and decrease back after my mouse moves away from it?
http://wiki.roblox.com/index.php?title=API:Class/ClickDetector
It details MouseHoverEnter
and MouseHoverLeave
as children of ClickDetector
01 | p = Instance.new( 'Part' , game.Workspace) |
02 | c = Instance.new( 'ClickDetector' , p) |
03 | script.Parent = p |
04 |
05 | script.Parent.ClickDetector.MouseHoverEnter:connect( function () |
06 | p.Size = Vector 3. new(p.Size.X* 2 ,p.Size.Y* 2 ,p.Size.Z* 2 ) |
07 | end ) |
08 |
09 | script.Parent.ClickDetector.MouseHoverLeave:connect( function () |
10 | p.Size = Vector 3. new(p.Size.X/ 2 ,p.Size.Y/ 2 ,p.Size.Z/ 2 ) |
11 | end ) |
That should double the size when mouse hover enters, and go back to normal when it leaves.