I don’t really understand it very well myself but the “vr expansion plugin” template has an example of that behavior in it.