D
D
dani220232021-10-10 11:43:58
C++ / C#
dani22023, 2021-10-10 11:43:58

Why doesn't a note play when a key is pressed?

I can't play a note when I press a key, what should I do?

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

public class ss : MonoBehaviour
{

    [SerializeField] public AudioSource odin;


    void Start()
    {

    }


    private void aboba()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            odin.Play();
        }

    }

   


}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Boronnikov, 2021-10-10
@dani22023

Because the aboba . Rename to Update and everything should work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question