Search Unity

Beginner game dev here "No overload for method 'Move' takes 3 arguments"

Discussion in '2D' started by FriedNoooodle, Aug 10, 2019.

  1. FriedNoooodle

    FriedNoooodle

    Joined:
    Apr 12, 2019
    Posts:
    5
    I'm following a brackeys tutorial, and about halfway through the video we make it to this point
    and I get "No overload for method 'Move' takes 3 arguments," I check the video and he doesn't get this error.
    I'm not sure what to do.
    Video Here:

    https://www.youtube.com/watch?v=dwcT-Dch0bA&t
    Code here:

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

    public class movement : MonoBehaviour
    {
    public CharacterController controller;
    float horizontalmove = 0f;
    public float runSpeed = 40f;

    void Start()
    {

    }

    void Update()
    {
    horizontalmove = Input.GetAxisRaw("Horizontal") * runSpeed;
    }

    void FixedUpdate()
    {
    controller.Move(horizontalmove * Time.fixedDeltaTime, false, false);
    }
    }
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    Please use code tags to make your code easy to read in your posts.

    In the video, his controller variable is of type CharacterController2D. You've got CharacterController as the type of yours.
     
    Last edited: Aug 10, 2019
    Sicknostalgia likes this.
  3. FriedNoooodle

    FriedNoooodle

    Joined:
    Apr 12, 2019
    Posts:
    5
    ohhh got it working thanks so much!