Help with this code

I’m using this code to present the y value of a moving object into text. There are multiple errors because it does not derive from mono-behavior and other things, what does it mean, and can somebody help fix it?

Code: `using System;
//using System.ComponentModel;
//using System.Reflection;
using UnityEngine;
using UnityEngine.UI;

public static class ExtensionMethods {
public static void MoveWithOutput(this Transform transform, Vector3 newPosition, InputField targetInputField)
{
    targetInputField.text = transform.position.y.ToString(); // Global Position Y
    transform.position = newPosition;
}

}`

Thanks! @zakkaiokenx10

Why is everything commented?

I uncommented everything and uncovered that your class compontentmethods does not derrive from mono behavior.

You can do that by putting " : MonoBehavior" on the class

using System;
using System.ComponentModel;
using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
public static class ExtensionMethods : MonoBehaviour { 
    public static void MoveWithOutput (this Transform transform, Vector3 newPosition, InputField targetInputField) { 
        targetInputField.text = transform.position.y.ToString ();  Global Position Y transform.position = newPosition; 
        } 
    }

I don’t understand what youre doing, but this will fix that monobehavior problem.