0

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?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Csabi
  • 3,097
  • 17
  • 59
  • 107

1 Answers1

1

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.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • 1
    Thank you Andy, what that means I am not able to apply force on a specific position? I am still struggling till today to achieve my goal. let me ask another question with more code example will link it in the comment here – Csabi Feb 09 '22 at 07:45
  • 1
    Hi @Csabi, post a new question – I'll try to answer it. – Andy Jazz Feb 09 '22 at 07:50
  • 1
    https://stackoverflow.com/questions/71046250/realitykit-add-force-to-entity-at-specific-point Thank you Andy here it is, hope I have been clear, if not feel free to ask more in the comments thank you :) and you made my day! – Csabi Feb 09 '22 at 08:33