Hi there! I would like to rotate my object according to the camera movement like this demo here, so it will always be facing the user.
Is there any way I can make this possible?
Hi there! I would like to rotate my object according to the camera movement like this demo here, so it will always be facing the user.
Is there any way I can make this possible?
If you’re using Cloud Editor you can add the xr-extras manipulate components to your entity.
If you’re using Niantic Studio, you could add a “Look At” animation component that is set to look at the camera.
Thank you so much on the reply! I am currently using Cloud Editor and I have studied around the xrextras manipulate components but I am still not sure what I should use so I can only change the rotation of the object to “look at” the camera…
If you just want the object to “look at” the camera you can use this custom component I found:
You’ll need to put the component registration into your app.js and then you can use it in your body.html.
Thank you for another great solution! I have tried this but this is not exactly what I want to achieve. I want my marker object can rotate along with the camera so it is always parallel with the user’s perspective but still can go near and far according to user’s phone orientation like the example above. The look at component stuck my marker on the screen. It was my mistake that I didn’t explain clearly.
It sounds like you want to use the look-at component, but disable rotation on the Y axis - is that correct? Check out this sample project:
If you want to achieve the same functionality, you can use our custom look-at component which disables Y rotation by default.
Oh my god!!! This is exactly what I wanted to do! Thank you so much for the help!!