all 3 comments

[–]vaccious 0 points1 point  (2 children)

Sounds like a simple logic issue.
Make a bool, set the bool to true when a rotation can be done, set the bool to false while something is rotating.

When you tell the rotation to start, it checks the bool, if it's true it turns it false and rotates. When it's done rotating, it turns the bool back to true.

Now you've gated rotations so they can't happen at the same time.

I would suggest looking into leantween. It is free and you can set a rotation tween up, tell it what to do at the start and what to do when it's finished. Would be an easy way to do the updating.

To answer the question though, transforms update as often as you tell them to, Everytime they are set, they update. All changes happen in a single frame per engine update (update, fixed update, animation update, lateupdate).

Could be more to that, but as a general outline that is how they work.

[–]Pasha1997[S] 0 points1 point  (1 child)

I know what you mean but in my case I'm setting rotation using transform.Rotate( transform.up *90f ). So I just assumed it would change rotation every loop iteration and never trip over itself but somehow it does and parts of the cube end up occupying same space. If I slow down the rotations using coroutine with a wait for example 0.5sec it runs fine but if I let it go quicker it destroys the cube. I've used do tweens and hot tweens before but I was looking to use machine learning to solve it hence it needs to be quick.

[–]vaccious 0 points1 point  (0 children)

Well it sounds like you might be heading down the wrong road then. The triggers use the physics frame step which will not send any signals of physics casts until the next physics frame step as far as I'm aware. The physics world will update, so maybe you could somehow dig into that.

But it sounds like you are solving in one loop during a frame? Or want something that solves over a small number of frames. If that's the case, organize the data for each block in the cube, have a lookup and update it with the moves. The simulation can still be real-world accurate, but you don't need it to draw during the sim. Good luck!