Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An example method that gets subscribed to the OnLaserHitTriggered event. This is attached to an entity, and when the laser raycast hits the entity, damage is dealt to it.
private void OnLaserHitTriggered(RaycastHit2D hitInfo)
{
if (hitInfo.collider.gameObject == gameObject)
{
if (bloodParticleSystem != null)
{
bloodParticleSystem.Play();
HealthPoints --;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.