C
C#2y ago
Elmishh

❔ making objects rotate at a fixed speed (unity script)

im trying to create 2 objects one being the center and the other one rotating around it in a 3D world
16 Replies
Elmishh
ElmishhOP2y ago
and i want to be able to change the speed when wanted
anita
anita2y ago
What have you tried already?
Elmishh
ElmishhOP2y ago
nothing every google result is different
HimmDawg
HimmDawg2y ago
So what kind of rotation do you want? Should it just rotate around the center on one axis or should the object be able to change it?
Elmishh
ElmishhOP2y ago
one axis around the center Y axis i think
anita
anita2y ago
position an empty gameobject in the center, make the rotating object its child and rotate the emptygameobject. you can chose the otation speed yourself but you need to multiply it by time.deltatime
Elmishh
ElmishhOP2y ago
i thought of that and did all of it already but how do i rotate it
Elmishh
ElmishhOP2y ago
isnt transform.rotate instnat? instant?
anita
anita2y ago
what do you mean by instant?
Elmishh
ElmishhOP2y ago
it instantly moves the object
anita
anita2y ago
you need to call it in the update function and rotate by a small amount
Elmishh
ElmishhOP2y ago
it spins!
HimmDawg
HimmDawg2y ago
<a:hamispin_fast:1080674931198672916>
Elmishh
ElmishhOP2y ago
i may or may not have made a particle accelerator
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server