Calling a function on multiple of the same script?

I currently have on function called respawnPlayer that respawns the player at the nearest checkpoint when he dies. I also want some falling platforms to reset when he does so, so I used fallingPlatform.reset() to do it, but the issue was only one of the game objects followed this behavior, all of the others ignored it. I now have all of the game objects that need to do so as an array, but it isnt working. Here is both scripts

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

public class LevelManager : MonoBehaviour
{

    public GameObject currentCheckpoint;

    private FallingPlatform fallingPlatform;

    private playerController player;

    public GameObject[] fp;
    // Use this for initialization
    void Start () {
        player = FindObjectOfType<playerController>();   
        fp = GameObject.FindGameObjectsWithTag("Fall");
    }
   
    // Update is called once per frame
    void Update () {
       
    }

    public void respawnPlayer()
    {
        Debug.Log("Player Respawn");
        player.transform.position = currentCheckpoint.transform.position;
        foreach (GameObject falling in fp)
        {
            fallingPlatform.reset();
        }

    }

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

public class FallingPlatform : MonoBehaviour {

    private Rigidbody2D rb2d;
    private Vector2 startPos;
    private Quaternion startRot;

    public float fallDelay;



    void Start()
    {
        rb2d = GetComponent<Rigidbody2D>();
        startPos = transform.position;
        startRot = transform.rotation;

    }



    void OnCollisionEnter2D(Collision2D col)
    {
        if(col.collider.CompareTag("Player"))
        {
            StartCoroutine(Fall());
        }
    }

    IEnumerator Fall()
    {
        yield return new WaitForSeconds(fallDelay);
        rb2d.isKinematic = false;

        yield return 0;
    }

    public void reset()
    {
        GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Static;
        this.transform.position = startPos;
        this.transform.rotation = startRot;       
        print(gameObject.name);
    }

}

Thanks in advance!

I copied this from your first script:

 Debug.Log("Player Respawn");
        player.transform.position = currentCheckpoint.transform.position;
        foreach (GameObject falling in fp)
        {
            fallingPlatform.reset(); // This should be falling.reset();
        }

And made a comment in there. :slight_smile: You had the right idea, but used the wrong variable :wink:

Of course, how didnt I realise! I knew it was going to be some stupid mistake. Thanks for the help!

smiles. np.