I am currently working on an obby and I decided to add a developer product that lets you kill all players when bought except for the player that bought it. When these players die it will display them a death screen that states “(player name) killed you”.
Everything was working well until I recently added some image buttons for gamepasses. For some reason one of the image buttons overlaps the death screen and I have no idea why. I have tried to find differences in that image button’s properties, but everything seems to be the same as the other ones that get overlapped.
Hey, I totally feel you! Overlapping UI elements can be a real head-scratcher sometimes. Let’s see if we can figure this out together:
Check Z-Index: UI elements are often layered based on their Z-Index property. Maybe the image button that’s causing trouble has a higher Z-Index than the others. Check if you can adjust the Z-Index of that particular button to make sure it’s not overlapping the death screen.
Anchoring and Positioning: Sometimes, UI elements can overlap if they’re not anchored correctly or their positions are a bit off. Make sure the image button’s Anchors are set properly to where it should be, and its Position isn’t causing it to overlap the death screen.
Parent and Children: Check if the parent of the image button or the death screen might be affecting their positioning. A parent’s properties could influence how its children are placed on the screen.
Layer Order: If you’re using frames or other UI containers, the order in which elements are added to those containers might affect how they’re layered. Make sure the death screen is added to the parent container after the image buttons.
UI Scaling: If you have UI scaling enabled, it might be causing elements to overlap differently on different devices. Test your game on different devices to see if the issue persists.
Debugging: You can also use the “View” tab in the UI editor to visualize UI bounds, which can help you identify if elements are overlapping.
Remember, it’s all about those little details sometimes. Play around with the settings, and you’ll hopefully find the sweet spot where your UI elements aren’t overlapping anymore. Happy obby-building!