For some reason transform doesn't have a definition for localscale and I don't understand why

I am trying to make a health slider and I am using this script to move it but it says that transform doesn’t have a definition for local scale and I don’t know why. I am using a tutorial for this so I have very little understanding of this. Tutorial. This script accesses my health script which should be unrelated to this but I can add it if someone in the comments asks for it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HealthBArScript : Health
{
    private void Update()
    {
        transform.LocalScale = new Vector3(healthPoints / MaxHealth, 1.0f, 1.0f);
    }

}

1 Answer

1

For some reason the tutorial used L instead of l so the reason this happened is because the L should be lowercase