Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug (9,25): error CS0426: The type name 'OnFootActions' does not exist in the type 'PlayerInput'

Discussion in 'Scripting' started by CoolWertQ, Sep 29, 2023.

  1. CoolWertQ

    CoolWertQ

    Joined:
    Sep 29, 2023
    Posts:
    4
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.InputSystem;

    public class SoItMoves : MonoBehaviour
    {
    private PlayerInput playerInput; // Corrected casing
    private PlayerInput.OnFootActions wlak; // Check if OnFootActions is the correct type

    private WasdMove motor;

    void Awake()
    {
    playerInput = new PlayerInput(); // Corrected casing and assignment
    wlak = playerInput.OnFoot; // Corrected casing
    motor = GetComponent<WasdMove>();
    }

    void FixedUpdate()
    {
    motor.ProcessMove(wlak.Wasd.ReadValue<Vector2>()); // Corrected casing, assuming Wasd is the correct property
    }

    private void OnEnable()
    {
    wlak.Enable();
    }

    private void OnDisable()
    {
    wlak.Disable();
    }
    }





    HEEELLPP
     
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    738
    Did you make it?
     
  3. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    The tutorial you are copying this from structured things in a very confusing way. What you need to do is double check what you named your Input Actions Asset (the thing where you set up bindings and actions). You need to use that name instead of
    PlayerInput
    .

    The confusing part is that PlayerInput is actually an existing component in the input system, so their use of that name for the tutorial really confuses people.
     
    CoolWertQ likes this.
  4. CoolWertQ

    CoolWertQ

    Joined:
    Sep 29, 2023
    Posts:
    4
    It was named diffrent thank you