#MouseEnter() not firing [Frame]

1 messages · Page 1 of 1 (latest)

deft prawn
#

For whichever reason, Mouse Entered event doesn't fire any input at all even though my frame is set to Active and Interactible as true. The colors even show as randomized. I've tried this outside of the UIGridLayout with the same results. Why is this not working?!

scarlet steeple
#

Because of your for cycle, it will not stop for your function to do something, it will fire the function, then go to the next frame, and will kill the function your previous function

low apex
low apex
scarlet steeple
#

local slots = {frame1, frame2, frame3} -- your inventory slot
local Mouse = plr:GetMouse()
local plrGui = plr:WaitForChild("PlayerGui")

local function getFrame(frame)
    local guiObject = plrGui:GetGuiObjectsAtPosition(Mouse.X, Mouse.Y)

for _, currentFrame in ipairs(guiObject)
        if currentFrame == frame then
            return currentFrame
    end
    return nil
end

while task.wait() do
    local activeFrame = nil
    for _, element in ipairs(slots)
        activeFrame  = getFrame(element)
    end
    if activeFrame ~= nil then
        --here change your color or some shit
    end
end
Try this

scarlet steeple
low apex
#

just like how they put "DisableFallFromHeight" or something property in workspace that doesnt work

scarlet steeple
#

Maybe because of how "for cycle" works, the cycle begins it creating function in memory, cycle iteration ends - function gets deleted from memory

low apex
# scarlet steeple Not familiar with it

basically theres these 2 properties in the workspace called "FallenPartsDestroyHeight" and "FallHeightEnabled", FallenPartsDestroyHeight is an integer and FallHeightEnabled is a boolean. you would think FallHeightEnabled would disable FallenPartsDestroyHeight right? but nope, it does nothing

low apex
#

in this case he used :Connect()

scarlet steeple
low apex
#

no

#

hes basically creating a "Connection" and attach it to the frame basically checking if Mouse is Enter using the built in MouseEnter signal

#

i dont think for loops change the behavior of connection in general

scarlet steeple
#

Or maybe it does?

fallow lintelBOT
#

studio** You are now Level 4! **studio

low apex
#

try it yourself

scarlet steeple
#

Cannot currently - I am on my phone in school

low apex
#

maybe for example

#
    local baseplate = workspace.Baseplate
    baseplate.Touched:Connect(function()
        print("hello")
    end)
end```
scarlet steeple
#

Is it working?

low apex
#

i shouldve use Once for this example

#

but doesnt matter

#

that will print 5 times since you created 5 connections

scarlet steeple
low apex
#

im pretty sure inventorySlots is a table

#

he loops through it

#

and make a MouseEnter connection

#

on each frame

#

im not sure if the problem is with Activate or Interactable, but it sure isnt the script

scarlet steeple
low apex
#

like i said

#

it may be how roblox treats input on ui elements that have Activate disabled by default

scarlet steeple
low apex
scarlet steeple
low apex
#

thats what im saying 😭

#

it works fine but the problem is with roblox MouseEnter signal

#

it may not fire for frames even with active enabled

scarlet steeple
scarlet steeple