Unity 2d enemy movement like spiral path from outside the circle the centre
using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyMovement : MonoBehaviour { public float radius = 10; public float speed = 1; public float phase = 0; public float waveLength = 1; void Update() { phase += Time.deltaTime * speed; float x = radius * Mathf.Cos(phase); float y = radius * Mathf.Sin(phase); Vector3 center = transform.parent.transform.position; Vector3 pos = new Vector3(x, 0, y) + center; transform.LookAt(center); transform.position = pos; } }