Skip to content

Removing component or update gravity has no impact #69

@Utopiah

Description

@Utopiah

If I add physics to a <a-scene> I do get the expected behavior. Yet, despite https://github.com/c-frame/aframe-physics-system/blob/master/src/system.js#L442 if I do AFRAME.scenes[0].removeAttribute("physics") then nothing change, namely dynamic objects continue to fall.

I noticed this while trying to do AFRAME.scenes[0].setAttribute('physics','gravity:-.1') and noticed it had no impact.

So I thought maybe I could remove the component then add it again with the new gravity value.

Unfortunately it changed nothing.

Also note that, and I do not know if it's related that making the test scene without adding the component... still enable physics, e.g. :

<!DOCTYPE html>
<html>
  <script src="https://aframe.io/releases/1.7.1/aframe.min.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/c-frame/aframe-physics-system@v4.2.2/dist/aframe-physics-system.min.js"></script>
  <body>
          <a-scene>
  <!-- Camera -->
  <a-entity camera position="0 1.6 1" look-controls></a-entity>

  <!-- Floor -->
  <a-plane position="0 -2 0" rotation='-90 0 0' static-body></a-plane>

  <!-- Immovable box -->
  <a-box static-body position="0 0.5 -5" width="3" height="1" depth="1"></a-box>

  <!-- Dynamic box -->
  <a-box dynamic-body position="0 0.5 -0.2" width=".1" height=".1" depth=".1"></a-box>

    </a-scene>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions