What I might recommend doing in this case is having an Area that can detect whether the player is outside of the cockpit and then somehow informing the user that they have stepped outside of the bounds, maybe turning everything outside of the cockpit black and disabling player interaction until the player re-enters the cockpit.
That way, you can still give the player some freedom to move around, but without having to necessarily undo every movement.
That said, I believe the following code should remove the ability for the player to move around the scene in VR (untested):
extends ARVROrigin
var arvr_camera = null
export (Vector3) var additional_offset = Vector3.ZERO
var _last_camera_offset = Vector3.ZERO
func _ready():
arvr_camera = get_node("ARVRCamera")
func _process(_delta):
# Move the ARVR node back into position
translation.x += _last_camera_offset.x
translation.z += _last_camera_offset.z
# Get the new camera offset
_last_camera_offset = arvr_camera.translation + additional_offset
# Move this node in the opposite position as the translation of the
# ARVRCamera node, effectively canceling it.
# However, we only want to do this on the X and Z axes, as otherwise
# player height will not be taken into account
translation.x -= _last_camera_offset.x
translation.z -= _last_camera_offset.z
Though, as Megalomaniak mentioned, it may be very disorienting to not be able to move around the scene when your body is moving. Some players may get motion sick, which could be problematic.
Also, welcome to the forums!