How can I change Parent object's position in Unity
How can I change Parent object's position in Unity Image: I am trying to make it move entire Inventory object when dragging "NamePanel" object. I added this script to "NamePanel" object and it makes only NamePanel to move. How should I edit my script to do that? how can I get Parent's transform component? since I'm not a English speaker, it's hard to get information by only searching... public class InventoryControl : MonoBehaviour, IBeginDragHandler, IDragHandler { ///////////////////////////////////////////////////////////////////////////////////// public Vector3 offset; public void OnBeginDrag(PointerEventData eventData) { offset = transform.position - (Vector3)eventData.position; } public void OnDrag(PointerEventData eventData) { transform.position = (Vector3)eventData.position + offset; } ////////////////////////////////////////////////////////////////////////////////////// } ...