using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace  MPStudio
{
    

public class RandomPos : MonoBehaviour
{
    public float offset = 0.15f;

    private Vector3 initPos;

    public float cd = 0.2f;
    
    private void Awake()
    {
        initPos = transform.localPosition;

       // transform.Rotate();
        //Quaternion.Euler()
       //  Quaternion.Euler()
       // Quaternion.identity
    }

    // Start is called before the first frame update
  protected  virtual void Start()
    {
       InvokeRepeating(nameof(ChangePos),this.cd,this.cd);
    }

    // Update is called once per frame
    void ChangePos()
    {
        transform.localPosition=initPos+     new Vector3(UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f), 0).normalized*offset;
    }
}
}