From 23e0afec1ddd78bde2b528ea480e71664c1ef713 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Sun, 6 Nov 2022 22:16:25 +1100 Subject: Update XRServer with starting position of (new) current XROrigin3D --- scene/3d/xr_nodes.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scene/3d') diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp index f5d30c584f..ca7d1dfc1d 100644 --- a/scene/3d/xr_nodes.cpp +++ b/scene/3d/xr_nodes.cpp @@ -644,6 +644,12 @@ void XROrigin3D::set_current(bool p_enabled) { origin_nodes[i]->set_current(false); } } + + // update XRServer with our current position + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + xr_server->set_world_origin(get_global_transform()); } else { bool found = false; // We no longer have a current origin so find the first one we can make current -- cgit v1.2.3