I have looked into other similar posts and was unable to find exactly what i needed from them so sorry if you have seen a similar post.

Im working on a monogame GameObject class, and was implementing a system to parent and child GameObjects, however the current design only iterates through one level of the hierarchy, for instance if the Parent was I, its child J would move with it, however J's child Q doesn't move.

To fix this i was wondering if it would be possible to call the same method within itself

Here is the sample code for moving parent/child objects

```
        public void Transform(Vector2 newPosition)
        {  
            if (children.Count != 0)
            {
                foreach (GameObject i in children)
                {
                    Vector2 diff = new Vector2(-(position.X - newPosition.X), -(position.Y - newPosition.Y));
                    i.position = i.position + diff;
                    i.Transform(new Vector2(i.position.X, i.position.Y));
                }
            }
            position.X = newPosition.X;
            position.Y = newPosition.Y;
        }

```

As you can see im trying to run the method within itself, however, when the program is run, every child below the first parent doesnt move.

Thanks for any help