22-09-2023, 08:55 AM
(This post was last modified: 22-09-2023, 08:55 AM by josemendez.)
(21-09-2023, 05:48 PM)Alexander34 Wrote: Hello again. In my game there is an ObiRope stretched between two players. It can be lengthened and shortened (I do this thanks to cursor). I'm having trouble taking the centre of the rope and using DOTWEEN to animate moving the centre of the rope (like a hitch) to a certain position, with the characters hanging from both sides. Let me give you an example where you use a stick to lift the rope in the middle of its length. What is the best way to realise this? I created a group of particles and attached it to an empty object with components rigitBody and ObiCollider, but when you resize the rope via cursor this group of particles may disappear and when you increase the rope the attachment.target object appears outside the unity coordinates. In any case I think it is not the best idea to use particlesGroup on a rope dynamically changing its length. Maybe someone can tell me how to realise this feature in a stable way?
I also need the other player not to be suspended and be able to adjust the length of the rope while on one side of the chasm, while the other player can swing while hanging on his half of the rope above the chasm.
Hi,
Depends on the specifics of your use case, but chances are you'll need to deal with individual elements/particles in the rope to find out the center of a dynamically resized rope, and then set its position.
To find the center, pick the element that's it the middle of the rope.elements list. Then pick one of the particles at either end of the center element, and override its position.
let me know if you need further help,
kind regards