PlayerMovement.cs(20,20): error CS1061: 'Animator' does not contain a definition for 'setFloat'

I’ve searched for the solution all over the internet and couldn’t find anything that worked.

I’ve reinstalled .NET core SDK, .NET runtime, Unity (different versions, 2019 2020), visual studio code.

I just can’t figure it out how to solve this issue. Anyone got any ideas?

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

public class PlayerMovement : MonoBehaviour
{
public CharacterController2D controller;
public UnityEngine.Animator m_animator;

public float runSpeed = 40f;
float horizontalMove = 0f;
bool jump = false;
bool crouch = false;

// Update is called once per frame
void Update()
{
horizontalMove = Input.GetAxisRaw(“Horizontal”) * runSpeed;

m_animator.setFloat(“Speed”, Mathf.Abs(horizontalMove));

if (Input.GetButtonDown(“Jump”))
{
jump = true;
}

if (Input.GetButtonDown(“Crouch”))
{
crouch = true;
}
else if (Input. GetButtonUp(“Crouch”))
{
crouch = false;
}
}

void FixedUpdate()
{
// Move our character
controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);
jump = false;
}
}

The C# programming language is case sensitive. That means the capitalization of characters in method names needs to be exactly correct.

Here is the SetFloat method from the Unity manual: Unity - Scripting API: Animator.SetFloat

Notice it is called SetFloat with a capital S. Your code is trying to call something called setFloat. setFloat does not exist, which is exactly what the compile error is telling you.