Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Grab ball that is attached to rope
#2
(19-12-2020, 03:53 AM)Navvv Wrote: Hello,

So I have a ball attached to a rope that is attached to a pole. I don't want to grab the rope directly, but I want the user to be able to grab the ball that is attached to the rope and throw it around. Currently, when I try to move the ball transform in the editor view during runtime, it does not work very smoothly. If I change the ball transform too much, it glitches out and the rope spazzes out. I have checked to make sure the ball and rope are not colliding. Even in the "chains" demo, I tested it and if you try to move the ball during runtime via the editor it glitches out the rope and the rope flies everywhere. Please if you could give me some advice that would be very much appreciated.

If the ball is a rigidbody, moving it around using its transform does not make much sense as that ignores physics. It just sets its position, ignoring any forces and/or constraints applied to it.

You will be able to overstretch the rope ignoring any forces applied by the it, and the ball will move out of sync with the physics update (not in FixedUpdate, but in Update) causing all sorts of weird issues. This would happen with regular joints too.

Non-kinematic rigidbodies should be moved using forces/impulses/velocity changes, specially if they’re constrained (be it using joints and/or Obi attachments). See the “wraprope” sample scene: https://youtu.be/7ugSN7laNd4
Reply


Messages In This Thread
Grab ball that is attached to rope - by Navvv - 19-12-2020, 03:53 AM
RE: Grab ball that is attached to rope - by josemendez - 19-12-2020, 09:15 AM
RE: Grab ball that is attached to rope - by Navvv - 19-12-2020, 10:23 PM
RE: Grab ball that is attached to rope - by Navvv - 21-12-2020, 09:12 PM