Hey, little problem here!

FYI, i’m using Unity 2019.3 and a complete noob to C#.

I’m making a quick maze game using the knowledge I have, and I’m getting these errors:
Argument 1: cannot convert from ‘float’ to ‘UnityEngine.Vector2’
Argument 2: cannot convert from ‘float’ to ‘UnityEngine.ForceMode2D’

Here’s my code:

using UnityEngine;

public class PlayerMovement : MonoBehaviour
{

    public Rigidbody2D Player;
    public float speed = 100f;

   
    void FixedUpdate()
    {
        if (Input.GetKey("w"))
        {
            Player.AddForce(0f, speed * Time.deltaTime);
        }
    }
}

AddForce doesn’t take two numbers, it takes a Vector2 parameter (which contains the two numbers you’re trying to feed into it now) and a ForceMode parameter(which is optional).

Player.AddForce(new Vector2(0f, speed * Time.deltaTime));

Exactly what Manta says above, and some tools to help you out of your predicament:

Some help to fix “Cannot implicitly convert type ‘Xxxxx’ into ‘Yyyy’:”

http://plbm.com/?p=263

Thanks.