using System.Collections; using System.Collections.Generic; using UnityEngine; public class ResetSample : MonoBehaviour { public Transform[] Objects; private List PosList = new(); private List RotList = new(); void Start() { foreach (var obj in Objects) { PosList.Add(obj.position); RotList.Add(obj.rotation); } } public void Reset() { for(int i = 0; i < PosList.Count; ++i) { Objects[i].GetComponent().velocity = Vector3.zero; Objects[i].GetComponent().angularVelocity = Vector3.zero; Objects[i].SetPositionAndRotation(PosList[i], RotList[i]); } } }