rotate around the y axis, smoothly

how would you rotate an object around the y axis, consistently, and smoothly?

Attach a Constant Force to the object?

function Update()
{
    transform.Rotate(0, 1*Time.deltaTime, 0);
}

I don’t quite understand what you’re looking for. Maybe you should look into the Lerp functions?

I have

using UnityEngine;
using System.Collections;

public class Rotator : MonoBehaviour {

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		transform.Rotate(Time.deltaTime, 0, Time.deltaTime);
	}
}

and its not working

Perhaps you could explain more clearly exactly what you’re trying to do?

I am trying to have an object rotate around the y axis, i dont know what more i can say

http://forum.unity3d.com/threads/76865-Make-camera-perpetually-rotate-around-a-target.
The typo in your signature irks me, also if this is for a turntable animate the camera movement first, with a locator or something, then make the cam a child of it

what typo?, and that doesnt really help much, either

LETS PLAY GAMES!!!

should be…

LET’S PLAY GAMES!!!

Basically you just forgot the apostrophe between the T and the S. The use of five exclamation points is also questionable.

Anyway, to get back on track…

Do you want it to just rotate on its own, or do you want it to rotate around an object? Did you try Dman’s code out from the third post in this topic? Cuz’ the code he posted makes an object rotate. Did his code not accomplish what you wanted?

well, its supposed to be stressed. and this has nothing to do with my question

lol I meant the “were” typo that you’ve changed to where, so, thank you.

Had you read the link I posted you would have found this Unity - Scripting API: Transform.RotateAround

i looked at it, but i didnt know how to use it. I searched, and found it before, but again, i didnt know how to implement it

The only reason your script doesn’t work is because it’s rotating the object on the X and Z axis instead of the Y axis. what you should have is this:

using UnityEngine;
using System.Collections;

public class Rotator : MonoBehaviour {
        
        public float speed = 7.0f; //you can change this value in the inspector
 
	void Start () {
	}
	
	void Update () {
		transform.Rotate(0, Time.deltaTime*speed, 0);
	}
}

oh, and just in case (forgive me if this is patronizing) make sure you attach this script to the object in your scene…

Also, with respect, something that will help you – when you’re confused with something, take the time to express why you’re confused. get clear what you don’t understand, and you will no doubt get lots of help. You’re getting some flak right now from some of these folks because (I think) It souunnddsss vaguely like you’re not even particularly interested in really digging in and fighting through your own confusion. If that is true, you’re getting into the wrong field, my friend…

Well, the problem is, its not rotating at all. and im pretty sure Im supposed to do what I did, with the rotation set for x and z, but i might be wrong, but what i know for sure is, its not rotating at all

  1. is the script attached to the object?
  2. wanting to rotate on y by rotating around x and z seems counter-intuitive to me. What makes you think this? I’m curious
  3. I actually have the script that I pasted running in unity. I’m watching the object rotate on y RIGHT NOW. it’s a beautiful thing! :slight_smile:

of course the script is attached, in the past, ive had to do that with a “look at” script, though i might be wrong on this occasion

and it doesnt work

Not to mention in his original code, he is not using a speed variable. Instead he is attempting to rotate by the Time.deltaTime value, which I believe gets rounded down to 0, resulting in no rotation.

Have you tried copying+pasting hypnoslave’s code?

i did, and it didnt do anything

I don’t know what to tell you. I created a new project, added a cube, and attached this script to it. I started the game and it began rotating.

Maybe you have another script attached to it that either changes the rotation each frame or disables the rotation in some way?