- Home /
Rotation speed,Rotate script slows down
Hi! First-time poster here. I'm going through the "Foundations" tutorial, and I got to the part where I write a script to make an object rotate (a platform to catch a ball). It worked, but the rotation is not at all consistent. 1) Yesterday it would slow down in certain spots, in a glitchy sort of way. The other actions did not seem to have the same problem, like the movement and growth of the ball. 2) Today, in the editor it appears to be better, but still happening. It will at least catch the ball on completing one rotation like I intended it to. 3) Now it is published, and the published version rotates much, much slower than anything I was in the editor and does not function the way I meant it to.
No other components have been added or changed beyond the transform and its script on this object. Can someone help me make sense of this?
Thanks in advance! Links below:
Published Game: https://play.unity.com/mg/other/high-roller-1
Tutorial Section (cf. Step 5): https://learn.unity.com/tutorial/change-a-gameobject-with-script?labelRequired=true&pathwayId=5f7bcab4edbc2a0023e9c38f&missionId=5f777d9bedbc2a001f6f5ec7≺ojectId=5fa1dddeedbc2a0020bc3ea1#5fab0c82edbc2a0020fa49a6,Hi! First-time poster here. I'm going through the "Foundations" tutorial and got to the part where I write a script to make something rotate. It works on my object (a platform to catch a ball), but the rotation speed is not consistent at all. 1) When I first made it, in certain spots it slowed down its rotation speed, in a glitchy sort of way. I also noticed that other movements were not glitchy at the same time, like the movement and growth of the ball, so it appeared to be something wrong with the function of that item and action in particular. 2) Now a day later, in my editor, it is improved, but still happening. The ball lands on the platform like I intended it to, but the rotation is not consistent. 3) I just published it to the website, and the speed seems mostly consistent, but it's much slower than anything I saw in the editor.
No components have been added or adjusted beyond the transform. Can someone help me make sense of this?
Thanks in advance!
Published Game: (https://play.unity.com/mg/other/high-roller-1)
Tutorial section (cf. Step 5): (https://learn.unity.com/tutorial/change-a-gameobject-with-script?labelRequired=true&pathwayId=5f7bcab4edbc2a0023e9c38f&missionId=5f777d9bedbc2a001f6f5ec7≺ojectId=5fa1dddeedbc2a0020bc3ea1#5fab0f1eedbc2a043f506f5c)
Answer by GeroNL · Feb 24, 2021 at 06:43 AM
Maybe you need to multply by Time.deltaTime, like this :
transform.Rotate (rotateChange * Time.deltaTime);
why you need to use this, try to read this : https://answers.unity.com/questions/296336/timedeltatime.html#:~:text=deltaTime%20allows%20you%20to%20move,time%20rather%20than%20by%20frame.
Hope it help.