Button should change float value

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

public class SelectedLevel : MonoBehaviour
{
    public float NextLevel = 0;

    public void SelectLevel (float selectedlevel)
    {
        selectedlevel = NextLevel;
    }

I took this on a button.
When I press the button and the float selected Level is for example 1, NextLevel should be 1 too how can I do that ?
Thank you :smile:

NextLevel = selectedlevel ;

also its better if you changed to int instead of float, umless you need 1.5level etc

1 Like