TG9six 03a642d635 first push
first push
2025-09-06 17:17:39 +04:00

21 lines
511 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpinAndBob : MonoBehaviour
{
[SerializeField] private float speed = 25f;
private float amplitude = 0.1f;
// Update is called once per frame
void Update()
{
transform.RotateAround(transform.position, transform.up, Time.deltaTime * speed);
Vector3 pos = transform.localPosition;
pos.y = Mathf.Sin(Time.time * 2f) * amplitude;
transform.localPosition = pos;
}
}