Files
2024-11-20 15:21:28 +01:00

27 lines
638 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LuxLWRPEssentials.Demo {
public class AnimateSphere : MonoBehaviour
{
Transform trans;
float yPos;
// Start is called before the first frame update
void Start()
{
trans = GetComponent<Transform>();
yPos = trans.position.y;
}
// Update is called once per frame
void Update()
{
var position = trans.position;
position.y = yPos + Mathf.Sin(Time.time) * 2.0f;
trans.position = position;
}
}
}