hello i have camera rotating around pivot working
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraRotate : MonoBehaviour
{
public float speedH = 2.0f;
public float speedV = 2.0f;
private float yaw = 0.0f;
private float pitch = 0.0f;
// Update is called once per frame
void Update()
{
yaw += speedH * Input.GetAxis("Mouse X");
// pitch -= speedV * Input.GetAxis("Mouse Y");
transform.eulerAngles = new Vector3(0, yaw, 0.0f);
}
}
this , and i have another code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraRotation : MonoBehaviour
{
public float speed = 10f;
// Update is called once per frame
void Update()
{
transform.Rotate(0, speed * Time.deltaTime, 0);
}
}
this, but i cant get them both work together, how to do this?