Z
Z
Zefirot2022-03-18 16:23:38
Unity
Zefirot, 2022-03-18 16:23:38

How to assign coordinates to an object?

It would seem that the simplest task is to assign coordinates to an object.

Debug.Log("1> (" + ArrayCell[i].transform.position.x + ", " + ArrayCell[i].transform.position.y + ")");
Vector3 TV = RoundVector3(ArrayCell[i].transform.position, 2);
Debug.Log("2> (" +TV.x + ", " + TV.y +")");
ArrayCell[i].transform.position = TV;
Debug.Log("3> (" + ArrayCell[i].transform.position.x + ", " + ArrayCell[i].transform.position.y + ")");

and here is the result
1>(2, 5.120002)
2>(2, 5.12)
3>(2, 5.120002)

Here I am stuck, it seems like the simplest task, but .....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Savelyev, 2022-03-18
@AgentSmith

There is no coordinate assignment in your code. There is only reading

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question