Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animation Event Method Has No Receiver Error.

Discussion in 'Animation' started by todddalton, Aug 1, 2020.

  1. todddalton

    todddalton

    Joined:
    Jul 26, 2020
    Posts:
    5
    I'm really new to Unity and am working through the RayWenderlick tutorials. I've been mod'ing the examples to try and learn more.

    https://www.raywenderlich.com/6570-introduction-to-unity-ui-part-1#toc-anchor-007

    There's an animation to slide a button off the screen and I'd like to start the game as soon as the animation finishes. But after adding and setting up an event in the animation timeline I get this error:

    Screenshot 2020-08-01 at 19.56.07.png

    I've seen answers on this forum about Coroutines and there's other forums with questions about the same error messages but they don't solve my issue (they mainly seem to centre around the fact that there's two animation events and the duplication is causing issue).

    Here's a screenshot of the only animation event in my project:

    Screenshot 2020-08-01 at 19.53.04.png


    And this is the StartButtonEndAnimationScript:

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

    public class StartButtonEndAnimationScript : MonoBehaviour
    {
    public bool shouldStartGame = false;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
    }

    public void KickOffGame() {
    Debug.Log("Ended");
    }
    }