How could I be rotating a asset ?

Hi

I am trying to rotate an object into c# code. How could I do it?

My code:

AssetBundle bundle = www.assetBundle;
        if(www.error == null)
        {
            GameObject cube = (GameObject)bundle.LoadAsset("cube");
            Instantiate (cube, new Vector3 (0, -20, 230), Quaternion.identity);

            Debug.Log ("Received from Web: " + cube.gameObject);
        }
        else{
            Debug.Log(www.error);
        }

Thank You

https://www.google.com/search?q=unity+rotate

I am trying that.

Instantiate (cube, transform.Rotate(0,20*Time.deltaTime,0));

Thank You

its not how Instantiate works!!

I thing before using Instantiate function, you just need to create a simple cube

try this script

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        // Rotate the object around its local X axis at 1 degree per second
        transform.Rotate(Vector3.right * Time.deltaTime);

    }
}

its from Unity - Scripting API: Transform.Rotate

  1. Create a new cube (or any other visual object)
  2. Attach the script to it, and hit play