aframe: Cannot programatically set rotation in v0.8.0

Description:

For some reason, using setAttribute will no longer allow me to programmatically rotate the camera via a component’s init.

Please view the glitch above, view the non-working example, then uncomment the 0.7.1 CDN version to see it work.

I’ve scoured the API, but can’t see any updates to method signatures or the like for this version.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (16 by maintainers)

Most upvoted comments

It is in the docs for master; I guess it just never made its way over to 0.8.*.

https://aframe.io/docs/master/primitives/a-camera.html#manually-positioning-the-camera

You’ll need to use a wrapper entity — the camera entity itself should not be rotated directly. For example:

<a-entity id=“rig”>
  <a-entity camera look-controls position=“0 1.6 0” />
</a-entity>

Some examples with aframe extras:
https://github.com/donmccurdy/aframe-extras/tree/master/src/controls

I thought we’d documented this somewhere, but it’s notably not there on the camera docs so I agree it should be added…

I understand the reasons now, however, this doesn’t really help with my particular situation unless I’m missing something in those comments.

For instance, to restore basic camera fencing capability, I now need to figure out some way to merge the ‘camera rig’ angle with the room angle so it makes sense for the user. Unfortunate as I don’t particularly have time to wait for contribs to be updated.

image

Can I suggest documenting this change so others don’t proceed down the v0.8.x route without understanding the breaking changes for existing projects?