29-09-2022, 01:48 PM
(29-09-2022, 10:17 AM)josemendez Wrote: Hi,
You've created an empty particle group, hence the null ref exception: there's no particles in the group to copy to the attachment. You need to first specify which particles are part of the group. Like this:
Code:var group = ScriptableObject.CreateInstance<ObiParticleGroup>();
group.particleIndices.Add(particleIndex); //<-- add at least one particle to the group.
_lastAttachment.particleGroup = group;
There's no need to give a name to the group or make it part of the blueprint unless you later want to retrieve it by name.
kind regards,
where particlesIndex is
Code:
var particleIndex = rope.solverIndices[rope.elements[rope.elements.Count - 1].particle2];
It is working as I see, but always have a very big gap between the body part and the rope's end