I’m in the “SendMessage() Between Components” video… and my send message does not work … the code on the collisionhandler.cs is
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollisionHandler : MonoBehaviour
{
// SHIPPING DATA //
// CHANGING DATA //
// * CODE * //
void OnTriggerEnter(Collider other)
{
StartDeathSequence();
}
private void StartDeathSequence()
{
print("player is dying");
SendMessage("OnPlayerDeath");
}
}
and the method on playercontroller.cs
void OnPlayerDeath() // RENAME WARNING called by string reference in CollisionHandler.cs
{
print("controls frozen");
}
all i get is “player is dying” in the console, so the method StartDeathSequence is called but the message isn’t received on the player controller
I’m using 2019.3.9f