Vector3 from another objects rotation

So I have a VR app in which I can switch rooms simply by pushing these floating buttons. But now I’m trying to create a transition animation. My goal is to move the camera towards the button pushed. The problem is, I do not have coordinates for these buttons. I’ve made a website where the user can place these buttons themselves on a 2D surface and in Unity, their position is only based on their rotation (and 40 on posZ for their child object that is the image of the button). Here are some pics to demonstrate:

Buttons placed on 2d surface on the website

The buttons have rotations on X and Y axis to determine their position.

Also I’m not interested in moving towards the button in vertical direction, horizontal only. So if the button is for example too high the animation would just go below the button.

I’ve tried something like this:

cam.transform.position = Vector3.MoveTowards(cam.transform.position, target, speed * Time.deltaTime);

but I don’t know how to fill the variable target, how to create a Vector3 from the information I have.

Hi, I really hope i understand you question correctly.

Do you have a reference to the objects at all even if you don’t have the world space? If so would this help at all?
ScreenToWorldPoint: Unity - Scripting API: Camera.ScreenToWorldPoint

If you don’t have references to the buttons could you use however the buttons were activated? This may be clunky but if you clicked on a screen you could use ScreenToWorldPoint as mentioned above and if its VR then could you use the hand position of the hand that activated.

As a side note, I don’t fully understand the project but you mention VR and moving the camera in VR without the player moving or blur effects etc can be quite sickening.

I’m not sure how useful this will be but I hope you fix your issue :slight_smile: