- Home /
Unfreezing rotation causes the position and rotation go crazy
I am currently making a game in which exact location and rotation are very important. So I want my Player to land exactly on 0,0.75,0 whenever the level starts:
however, whenever the player (blue cube) lands, the position and rotation change by a bit, which is a game breaker for me. I know that those are small numbers, but still, this IS a game breaker.
I tried to fix this with this piece of code, but it works only for the first second, and during that second I can't rotate the cube, which is also a game breaker:
IEnumerator OnCollisionEnter(Collision col)
{
if(col.gameObject.name == "Surface")
{
yield return new WaitForSeconds(1);
rb.freezeRotation = false;
}
BTW, I'm pretty new to unity (and doesn't know JavaScript at all), so please consider that when helping. Thanks for everyone who will!! :)
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Why is the camera going crazy when the player moves? 0 Answers
How can i place subjects in different positions? 0 Answers
I need help with a Text Location script (Ho bisogno di aiuto con uno script di posizione del testo) 0 Answers
2D Aiming in a 3D game 0 Answers