How to use UI to control camera in Hololens2?

Hao Wu 10 Reputation points
2023-06-14T13:59:14.76+00:00

Control Camera in Hololens

I want to use UI to move camera in Hololens2. When I directly control Main Camera, it does't works in Hololens。

Then I control MixedRealityPlayspace to move on Main Camera's axis.

Game.Find("MixedRealityPlayspace ").transform.Translate(new Vector3(0,0,2), Game.Find("Main Camera").transform)

This works in Unity Editor, but not work in Hololens。

Is there any method to solve this problem?

HoloLens | Development
HoloLens | Development
The process of creating immersive mixed reality applications for Microsoft HoloLens,
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.