• PixelVisible always returning 0
    0 replies, posted
I'm trying to create a glow sprite whose size is multiplied by its visibility, acquired via a util.PixelVisible call. I worked with PixVis handles before without a problem when caching them on SENTs and testing visibility on said SENT:Draw() calls. However this time the glow sprite is not related to any SENT, it's all just client autorun code. I blurred out parts of the code that I think aren't relevant to the problem so that the flow of the code still comes across (this is all under a CLIENT's autorun block): https://files.facepunch.com/forum/upload/710/d2ad7d46-660e-4b0e-92a8-cbc2ab48cb71/image.png So I'm: Creating a pixvis handle using util.GetPixelVisibleHandle(), and storing it in a 'context' table Passing that context table as the first argument to the function glowSpriteStep called by a PreDrawEffects hook Testing visibility in the glowSpriteStep function, the problem is that the value returned is always 0 What I want to find out: is this type of caching/referencing of the pixel visible handle knowingly wrong? If so I'll try a different solution, and if it should work, well I guess I'll try and dive deeper than I already have (not sure how I'll be doing that)
Sorry, you need to Log In to post a reply to this thread.