Hi total noob here,
I’m trying to rotate an object in unity using the code example in the documentation. However I’m unable to get the object to rotate at all and when I add a watch on the object in vs code debugger I just get the message:
"Time.deltaTime: Evaluate request failed (unknown member: Time)."
What am I doing wrong?
Here’s the offending code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotatePlaneWrapper : MonoBehaviour {
// Use this for initialization
public float rotateSpeed = 50f;
private KeyCode lastHitKey;
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown (KeyCode.D))
{
if(lastHitKey != KeyCode.D)
{
transform.Rotate(Vector3.right * rotateSpeed * Time.deltaTime );
lastHitKey = KeyCode.D;
}
}
if(Input.GetKeyDown (KeyCode.A))
{
if(lastHitKey != KeyCode.A)
{
transform.Rotate(Vector3.left * rotateSpeed * Time.deltaTime );
lastHitKey = KeyCode.A;
}
}
}
}