Move Staticmesh when in another object

Goodday!

I was wondering how I could make it so that every time this Navigation System goes in a tree by example it moves out of the tree.