When Im trying to set attachment to null im getting error.
I think it was working before, but when im checking now the source code of skeleton.cs it throws error when is null.
So how I can set a null attachment in that case?

/// <summary>A convenience method to set an attachment by finding the slot with FindSlot, finding the attachment with GetAttachment, then setting the slot's slot.Attachment.</summary>
/// <param name="attachmentName">May be null to clear the slot's attachment.</param>
public void SetAttachment (string slotName, string attachmentName) {
	if (slotName == null) throw new ArgumentNullException("slotName", "slotName cannot be null.");
	Slot[] slots = this.slots.Items;
	for (int i = 0, n = this.slots.Count; i < n; i++) {
		Slot slot = slots[i];
		if (slot.data.name == slotName) {
			Attachment attachment = null;
			if (attachmentName != null) {
				attachment = GetAttachment(i, attachmentName);
				if (attachment == null) throw new Exception("Attachment not found: " + attachmentName + ", for slot: " + slotName);
			}
			slot.Attachment = attachment;
			return;
		}
	}
	throw new Exception("Slot not found: " + slotName);

"May be null to clear the slot's attachment."
"if (attachment == null) throw new Exception("Attachment not found: " + attachmentName + ", for slot: " + slotName);"
x_X

    Related Discussions
    ...

    Scoppex but when im checking now the source code of skeleton.cs it throws error when is null.

    No, it's not:

    if (attachmentName != null) {
        attachment = GetAttachment(i, attachmentName);
        if (attachment == null) throw new Exception("Attachment not found: " + attachmentName + ", for slot: " + slotName);
    }
    slot.Attachment = attachment;

    If attachmentName is null, it just assigns null. Likely you have passed the empty string "" as attachmentName parameter here instead of null.

    Ok! Thank you so much for fast answer.