Audio Dialogue on Hover
Posted: Fri May 24, 2024 8:43 am
HI again!
looking at the forum, I noticed that playing a specific audio entry on hover to represent thoughts has been treated already, but unfortunately, the suggested solution is giving me an error.
I'm using this bit of code here, then connecting the event on the button responses and fire it when hovering.
However.. i'm getting that respondeButton doesn't exist in the current context error.
Is there a new way of doing it?
Thanks!
looking at the forum, I noticed that playing a specific audio entry on hover to represent thoughts has been treated already, but unfortunately, the suggested solution is giving me an error.
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers.DialogueSystem;
using PixelCrushers;
using UnityEngine.UI;
public class HoverButton : MonoBehaviour
{
public void PlayHoverSequence()
{
// Get the response associated with the button:
var response = GetComponent<UnityUIResponseButton>().response;#
// Set the response's Hover Sequence:
var sequence = Field.LookupValue(responseButton.dialogueEntry.fields, "Hover Sequence");
// Play the Hover Sequence:
DialogueManager.PlaySequence(sequence);
}
}
However.. i'm getting that respondeButton doesn't exist in the current context error.
Is there a new way of doing it?
Thanks!