Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

Fix spawned media menu target resolution #6363

Closed keianhzo closed 1 year ago

keianhzo commented 1 year ago

We were looking for the object menu target using the ObjectMenuTarget and MediaContentBounds components but more than one entity in the hierarchy can have those (spawned glTF that spawns media) but that's not the object the object menu actions (like pin) need to work on.

This PR updates the root object menu target lookup by looking for the Deletable entity that also has an ObjectMenuTargetcomponent.

We should probbaly try to find a better way of tagging this root entity that's more verbose. Something like SpawnedMediaRoot.

Fixes https://github.com/mozilla/hubs/issues/6360