Can't you rotate it based on a point other than the center of the object when you rotate it using lerp?
unity
public class RotateAroundTest : MonoBehaviour {
Vector3 point;
// // Use this for initialization
void Start () {
// // initial position
transform.position = new Vector3(0.0f, 0.0f, 5.0f);
// // center position (origin)
point = new Vector3(0.0f, 0.0f, 0.0f);
}
// // Update is called once per frame
void Update () {
transform.RotateAround(point, Vector3.up, Time.deltaTime * 50);
}
}
© 2024 OneMinuteCode. All rights reserved.