Restricting Object Movement and Rotation to XY Plane in 3DExperience with XR Controller

Hi everyone,

I'm currently working on a project in 3DExperience/ Creative Experience using XR controllers (Meta Quest 3) and facing an issue with restricting object movement and rotation. I want to limit an object's movement to the XY plane after being grabbed (prevent movement along the Z-axis). I'm using XR controllers to manipulate objects in the scene. Grabbing and releasing objects works fine. For specific objects, I want to enforce these restrictions to maintain their orientation and movement within the XY plane only. I’ve looked into modifying scripts (like XRGrab) and tried working with transformations, but I’m not sure how to effectively implement these constraints within the 3DExperience scripting environment.

Does anyone have experience with similar restrictions, or know of a simple way to enforce these constraints? Are there any example scripts or documentation that could point me in the right direction?

Any help would be greatly appreciated!

Thanks in advance!