Quantcast
Channel: Latest Questions by Rainmaker
Viewing all articles
Browse latest Browse all 4

Unity does not update fast enough

$
0
0
I have the following code in C#: transform.position = newMarblePos; Collider[] marbles = Physics.OverlapSphere(newMarblePos, 0.1f); Debug.Log (marbles.Length ) ; This prints out 0. This does not make any sense: clearly the GameObject should show up in the intersection. Why is this the case? Could it be that by the time of my Debug.Log statement, Unity has not updated the transform yet? Does Unity not wait for a statement to finish before executing the next one? Regardless, any insight into the cause of this bug and how to work around it would be greatly appreciated.

Viewing all articles
Browse latest Browse all 4

Trending Articles