Gameobject does not contain a definition for Parent

gameobject does not contain a definition for Parent
is the error I am receiving

Here is the code:

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

public class PlayerOnRope : MonoBehaviour
{
    public GameObject Player;

    public GameObject Bone1;
    public GameObject Bone2;
    public GameObject Bone3;
    public GameObject Bone4;
    public GameObject Bone5;
    public GameObject Bone6;
    public GameObject Bone7;
    public GameObject Bone8;
    public GameObject BoneEnd;


    void OnCollisionEnter(Collision col)
    {
        if (col.transform.gameObject == Bone1 || Bone2|| Bone3|| Bone4|| Bone5|| Bone6|| Bone7|| Bone8|| BoneEnd) {
            Bone1.Parent = gameObject;
            Debug.Log("Rope Hit");  
        }

    }


}

Should be

Bone1.transform.parent == gameObject.transform

It’s “GameObject.parent” (lowercase), not “Parent”.

Also, those chained “||” won’t work in the way you seem to think. That “if” clause checks if transform.gameObject equals Bone1, or Bone2 is not null, or Bone3 is not null, etc. It’s not checking if gameObject is equal to any of those bones. You need to compare with every bone for equality.