playMaker

Author Topic: Pressing a key to put some spheres in front of my VR headset/view  (Read 306 times)

ronantheodor

  • Playmaker Newbie
  • *
  • Posts: 1
Hi all,

I have a simple task that I need to do in unity. The user has a bunch of spheres in front of him, in a 180 degree arc (S1 to S11). These are all children of the 'Spheres' parent, because I need them to maintain relative position to each other.

I am trying to do a FSM where on pressing 'C', the spheres move in front of the VR camera (using Oculus, the 'RightEyeAnchor') and then are offset by a certain amount. The spheres should maintain the same arc 'layout', but move together, as a group, to a certain point in space - in whatever direction the user is facing, plus 0.5 units in front, so they can comfortably reach these targets with the controllers.

I have used 'get/set position' and 'get/set rotation', but it only works if I am facing in a certain direction and they do not seem to rotate properly. Essentially, I am just trying to 'recenter' the spheres in front of the camera + add an offset on the local z-axis.

There's probably an easier, much more obvious way I am missing, but I'm drawing a blank. Thank you in advance for your help!