Files

23 lines
574 B
C#
Raw Permalink Normal View History

2026-02-21 17:04:05 -08:00
using UnityEngine;
using System.Collections;
namespace Com.LuisPedroFonseca.ProCamera2D.TopDownShooter
{
public class ObjectMove : MonoBehaviour
{
public float Amplitude = 1;
public float Frequency = 1;
Transform _transform;
void Awake()
{
_transform = transform;
}
void LateUpdate()
{
_transform.position += Amplitude * (Mathf.Sin(2 * Mathf.PI * Frequency * Time.time) - Mathf.Sin(2 * Mathf.PI * Frequency * (Time.time - Time.deltaTime))) * Vector3.up;
}
}
}