Search code examples
swiftarkitrealitykitreality-composer

Move the centre of the force within Reality Composer scene


Based on the Apples custom behaviour documentation I am able to trigger addForce for my Entity and modify the velocity of the force and also the angle where it is applied. The only problem I am facing that I would like to apply the force on the certain area of my object not always on the center.

known functionality

I can get the point where the user tapped my object, but with notifying the addForce it always triggers the force application for the centre of my object. Like this the object behaves weird and I lost the immersion of the augmented reality, is there a way to modify the point where the force is applied?


Solution

  • Physics forces are applied to the model's pivot position. At the moment, neither RealityKit nor Reality Composer has the ability to change the location of an object's pivot point.

    In addition to the above, you've applied Add Force behavior that pushes an object along a specific vector with the definite velocity, however, user's taps occur along the local -Z axis of the screen. Do these vectors match?

    And one more note: within the Reality-family, only rigid body dynamics is possible, not soft body.