@JezuzLizard Not to annoyingly revive this long dead thread... but can I ask what "isHidden" is relating to here?
I was trying to figure it out for a while now, because this function wasn't working for me at first, but I found out it's because "isHidden" was always returning as false / 0 and basically prevented any of the function to actually execute.
I fixed it by removing "isHidden" but I was really curious to find out what it actually is.