Realm Rush coordinate system the lables are not going my one there gooing by 40

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

[ExecuteAlways]
public class CordinetLables : MonoBehaviour
{
TextMeshPro lable;
Vector2Int Coordinates = new Vector2Int();

void Awake()
{
    lable = GetComponent<TextMeshPro>();
    DisplayCoordinates();
}

// Update is called once per frame
void Update()
{
    if (!Application.isPlaying)
    {
        DisplayCoordinates();

    }   
}

void DisplayCoordinates()
{
    Coordinates.x = Mathf.RoundToInt(transform.position.x / UnityEditor.EditorSnapSettings.move.x);
    Coordinates.y = Mathf.RoundToInt(transform.position.z / UnityEditor.EditorSnapSettings.move.z);

    lable.text = Coordinates.x + "," + Coordinates.y;
}

}

Hi Andrew,

Welcome to our community! :slight_smile:

Unfortunately, I did not understand this problem. Could you please share a screenshot of what you see in Unity? Are there any error messages in your console?


See also:

Privacy & Terms