Skip to content

Joints #5

Description

@secretnoe-rblx

After testing Joints, I realized they don't affect Entities at all. I found your example, but even with it, I couldn't get anything done. Please help.
Example:

/// ```ignore
/// commands.spawn(BallSocketJoint::new(entity_a, entity_b));
/// ```

My code:

  // --- Dynamic sphere a ---
  let entity_a = commands.spawn((
      RigidBody::Dynamic,
      BepuCollider::sphere(1.0),
      Mass(1.0),
      Mesh3d(meshes.add(Sphere::new(1.0))),
      MeshMaterial3d(materials.add(StandardMaterial {
          base_color: Color::srgb(0.8, 0.2, 0.2),
          ..default()
      })),
      Transform::from_xyz(0.0, 4.0, 1.0),
  )).id();

  // --- Dynamic sphere b ---
  let entity_b = commands.spawn((
      RigidBody::Dynamic,
      BepuCollider::sphere(1.0),
      Mass(1.0),
      Mesh3d(meshes.add(Sphere::new(1.0))),
      MeshMaterial3d(materials.add(StandardMaterial {
          base_color: Color::srgb(0.8, 0.2, 0.2),
          ..default()
      })),
      Transform::from_xyz(0.0, 4.0, 0.0),
  )).id();

  commands.spawn(BallSocketJoint::new(entity_a, entity_b));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions