Using OnCollisionEnter with 3 objects

I’m trying to make a little game ish in my class but i just began programming a few weeks ago. So i want to do so when i hit an object, with my player it moves a different object. So when Players (1) hit my stribe, i want Death1 to move (ignore death2). but i don’t know how to put in that i want it to move death1, so it only moves my stribe right now.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[SerializeField] GameObject Death1;
[SerializeField] GameObject Death2;

private void OnCollisionEnter(Collision col)
    if ( == "Players (1)")
        Vector3 playerPosition = transform.position;
        playerPosition.x = 1.7f;
        transform.position = playerPosition;

void Start () {
Death1 = GetComponent();
Death2 = GetComponent();

Good day.

I’m not sure to understand what you need. As I understood, only need to change the position of the Object2.

You need to find that object inthe scene or assign it via inpecor, and just change vaue of


You should look some basic tutorials about referencing.