Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extend a rope when the attached object shot from a position
#11
(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
Reply


Messages In This Thread
RE: Extend a rope when the attached object shot from a position - by lacasrac - 29-09-2022, 01:48 PM