using UnityEngine;

public class FollowParentPositionOnly : MonoBehaviour
{
    public Transform parent;
    private Quaternion initialRotation;
    private Vector3 worldOffset;

    void Start()
    {
        if (parent == null)
            parent = transform.parent;

        // Store offset in WORLD space
        worldOffset = transform.position - parent.position;
        initialRotation = transform.rotation;
    }

    void LateUpdate()
    {
        if (parent == null) return;

        // Move child using stored world offset
        transform.position = parent.position + worldOffset;
        transform.rotation = initialRotation;
    }
}