How to rotate a gameobject around with a rotate speed

I’m trying to make a zombie survival game, just, the zombies don’t want to rotate around with a rotate speed,please help!:slight_smile:

Perhaps show us the code you already have? That’ll make it much easier than me telling you “use transform.localRotation on the Y axis”.

Can you write a script for sample?please.

I can’t show the script because I don’t know how to begin…

In that case, perhaps start with a much simpler game. There are loots of great tutorials available that teach you how to use code in Unity. There is no way we can tell you how to rotate an object without referring to other things you would not know how to do.

I like that you are being honest about this (I don’t know how to begin) - and that is indeed the correct question: how do you begin. Because the answer to 'how do I rotate an object in the world" is an answer to a much later question. Look at some beginner Scripting tutorials. You’ll soon find after a short while you’ll be able to not unly understand how to answer that question yourself, you’ll also understand how that answer fits with the rest of unity.

In case you don’t believe me, here’s the actual answer to your question:

Zombie.transform.rotate(0f, rotateSpeed * Time.deltaTime, 0f, Space.Self);

… but it is highly unlikely that this helps you. Here’s some more info, and that may get you started. Take the time and watch the intoduction to programming tutorials, they really are woth it.

1 Like

Thanks, i will try it!:slight_smile: