Hi!
The picture should show what I am tryng to achieve. My rope consists of two parts:
1. A static rod that is attached to the character's left hand
2. A dynamic rope that starts from the character's left hand
The rope is dynamically generated using two control points with tangent vectors, so the rope path points out from the character's hand to the correct direction. The rope attaches to the hand using a static attachment. This part works flawlessly.
However, after physics the rope is hanging towards the ground from its attachment. I would like it to be stiff in the first few particles, then loosen up, gradually, if possible. The first particles in the attachment should respect the original path direction.
How would you suggest I achieve this? Maybe adding some constraints to the first particles. I don't know how to do this, it gets complicated.
Here's the blueprint generating code.
The picture should show what I am tryng to achieve. My rope consists of two parts:
1. A static rod that is attached to the character's left hand
2. A dynamic rope that starts from the character's left hand
The rope is dynamically generated using two control points with tangent vectors, so the rope path points out from the character's hand to the correct direction. The rope attaches to the hand using a static attachment. This part works flawlessly.
However, after physics the rope is hanging towards the ground from its attachment. I would like it to be stiff in the first few particles, then loosen up, gradually, if possible. The first particles in the attachment should respect the original path direction.
How would you suggest I achieve this? Maybe adding some constraints to the first particles. I don't know how to do this, it gets complicated.
Here's the blueprint generating code.
Code:
this.Blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
this.Blueprint.resolution = 0.7f;
this.Blueprint.pooledParticles = 200;
this.Blueprint.thickness = 0.04f;
this.Blueprint.path.Clear();
this.Blueprint.path.AddControlPoint(ropeHolderLocalPosition, -ropeHolderLocalPosition, ropeHolderLocalPosition, Vector3.up, 0.1f, 0.1f, 1, collidesWithEverythingFilter, Color.white, "left-hand");
this.Blueprint.path.AddControlPoint(this.ParticleRope.transform.InverseTransformPoint(this.RopeAttachment.transform.position), -hookLocalPosition, hookLocalPosition, Vector3.up, 0.1f, 0.1f, 1, collidesWithEverythingFilter, Color.white, "hook");
this.Blueprint.path.FlushEvents();
yield return this.Blueprint.Generate();