UI "Image" turns into "Script"

Im following a tutorial on creating a healthbar "

". After having created it like at 7:17 my “fill”, “border” and “heart” objects turn invisble and become “script” instead of staying “image” like in the video when he creates the script HealthBar and references it in “Player”.

Have searched for a solution but haven’t found anything. I also get the errors:
The referenced script on this Behaviour (Game Object ‘Border’) is missing!

The referenced script on this Behaviour (Game Object ‘Fill’) is missing!

The referenced script on this Behaviour (Game Object ‘Heart’) is missing!

My code:
using System.Collections;
using System.Collections.Generic;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;

public class PlayerMovement : MonoBehaviour
{

[SerializeField] private Slider healthSlider;

private int startingHealth = 5;
private int currentHealth = 0;

public void TakeDamage(int damageAmount) {

currentHealth -= damageAmount;

UpdateHealthBar();

if(currentHealth <= 0) {
//Respawn
Respawn();
}

}

private void Respawn() {

currentHealth = startingHealth;

UpdateHealthBar();

}

private void UpdateHealthBar() {
healthSlider.value = currentHealth;
}
}

Can you share some screenshots of how you have set up your object in the scene?
Did all of the components show up as Images as expected initially, and then broke after you made some change?

By the way, here is some info on how to post code properly to the forums: Using code tags properly

After testing more it doesn’t seem to be a problem with any of my scripts. If i create any type of UI Slider and press play it turns invisible and all children “Images” become “Scripts”. This happends even if i dont use it for anything.

Here are 2 pictures before and after pressing play on a completely fresh Slider.

I tried creating a new project and there i succeded, no idea why.


Does this happen even if you make a new blank scene that has only the canvas and slider (and EventSystem)?

Yep. I managed to fix it by adding a raw image component and deleting the script. But im missing some image features.