Gui problems with a death screen

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.

Here is the script that I am using to display the death screen:

local label = Frame.TextLabel

game.ReplicatedStorage.KilledPlayer.OnClientEvent:Connect(function(player)
	label.Text = player.Name.." killed you"
	Frame.Visible = true
	wait(3)
	Frame.Visible = false
end)
1 Like

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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! :running_man::video_game::hammer_and_wrench:

2 Likes

I changed the death screen ScreenGui DisplayOrder to a higher number than the image button ScreenGui and it worked!

1 Like

np man i am very happy for you that it worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.