Scripting for sliders

Hey guys, I’m working on a project for school, we never learnt any scripting so I’m on my own with that. Im trying to get a slider to change the value of the constant force that I’ve applied to my object. If anyone could help me that would be greatly appreciated! Thanks!


[Range(0.0f, 10.0f)]

public float mySliderFloat;


@Range (0.0, 10.0)

var mySliderFloat;


  [Range(0.0F, 10.0F)]
    public mySliderFloat as float = 0.0F