public class player : MonoBehaviour
public float speed;
private Rigidbody2D rigidbody;
rigidbody.velocity = new Vector2(speed, rigidbody.velocity.y);
i used this as shown in tutorial in you tube .
the tutor got the speed option to change speed .help please
Now that you have declared a public member (public float speed), click on the object in your Scene and look at the Inspector tab. There you will find your script (remember to add your script to the gameObject if you haven’t done so) and you will also find your variable “speed”. If you press play and change the speed in the Inspector, it will change your character’s speed too. Remember that you also need to add a Rigidbody2D component to your gameObject!
@everyone who replyed thank you I don’t know what happened but now I can see the speed variable