T
T
twilighthasan2020-10-11 16:34:49
Unity
twilighthasan, 2020-10-11 16:34:49

Errors in the values ​​of the vector3 axes, when assigned to a field?

Friends, the question is that when assigning the position of one object to the vector3 field, an error of 0.1f is obtained in the values. I launched Unity, paused and started scrolling through the frames, and realized that somehow all this was late. All code of all objects works in FixedUpdate.

Vector3 setPos2;
 void FixedUpdate()
    {
setPos2 = CosAndSin_Operation.transform.localPosition;
}
private void Update()
    {
        text.text = setPos2.ToString() + " \n" + CosAndSin_Operation.transform.localPosition;
    }

WULTE2552-1.gif
I get a link to the CosAndSin_Operation object in the inspector.
What to do so that there are no errors?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-10-11
@twilighthasan

How does CosAndSin_Operation move?
You dump the coordinates in FixedUpdate - it is absolutely not synchronized with the update

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question