Assets\Infima Games\Low Poly Shooter Pack\Code\Demo\DisplayMaterialName.cs(43,13): error CS0118: ‘TextMeshProUGUI’ is a type but is used like a variable
This is my code :
// Copyright 2021, Infima Games. All Rights Reserved.
using TMPro;
using UnityEngine;
namespace InfimaGames.LowPolyShooterPack
{
///
/// Displays a material’s name in the world.
///
public class DisplayMaterialName : MonoBehaviour
{ #region FIELDS SERIALIZED
private void Start()
{
//Get current material name from the mesh.
string sharedMaterialName = mesh.sharedMaterial.name;
//Output current material name to the UI text.
TextMeshProUGUI = sharedMaterialName;
}
When posting code on the Scripting forum, make sure to use Code Tags so people can read your code easily. You can edit your post and add it.
The error tells you what’s wrong, you used a type like a variable. I don’t even know what you’re trying to do, so I can’t help you unless you explain it.
On another note, I’d suggest following some basic coding tutorials instead, C# has strict rules on how the syntax works, and if you don’t know those you’re not going to get anywhere.