i wrote a script everything should work but it doesnt
Check console if there are any errors? (then script hasn’t compiled yet)
If not that,
Can you show your script (or part of it) ?
First I would start with the 10 Trillion tutorial videos available on google.com
This assumes you understand the basics. If you don’t, go here first https://learn.unity.com/
Please stop making low-effort posts; your topic history is full of them.
If you’re not willing to take the time to write a detailed post that fully describes your problem, providing any code you’ve written, explaining what you expected to happen, what actually happened, and outlining the solutions you’ve tried, why do you expect others to invest their time answering vague, generic questions?
This isn’t a matter of being new here. You’ve been in the forums for over a year, and nearly all your topics follow the same pattern: asking abstract, generic questions and then failing to follow up. You don’t clarify if something worked, if you found a solution, or even say a simple “thank you.”
The community isn’t here solely to serve your needs. Please take a moment to read the Unity Community Code of Conduct, which explicitly addresses low-effort posts: https://discussions.unity.com/faq
if it was the old unity forums i would make better posts
heres my script
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class CoinSystem : MonoBehaviour
{
public static int Coins;
public TextMeshProUGUI CoinCounter;
// Start is called before the first frame update
void Start()
{
UpdateCoinText();
}
// Update is called once per frame
void Update()
{
}
private void OnColliderHit()
{
}
public static void UpdateCoinText()
{
CoinCounter.text = Coins; // Update text
}
}
ok, its static field, so unity wont show it.
Is it static so that you can access it from other scripts?
yes i have textmeshprougui and it doesnt show it
oh no need now chatgpt solved it
Ignoring but adapting the unhelpful posts.
any field, private etc if you add [SystemSerializable] will make it show in editor, this is a C++ command for the system that says “Hey THIS THING IS VITAL”, regardless of its status. I do agree, your original post was lacking in information, but rectified later, first post should include as much information as you know, subsequent should be “Oka, listening to the advise here is updated xyz”
This is not a C++ command, c++ has nothing to do with it, this is a C# attribute: https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute?view=net-9.0
It doesn’t mean "THIS THING IS VITAL” it means that this field can be serialized using binary or XML serialization.
- binary serialization as stated by microsoft is and they admit, 100% unsecure
- C# is literally based on c++
XML is a markup language and not one to be used to dictate code more of how it should appear, as is the same for xHTML etc