Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Specifying player's damage in enemy's damage function inside enemy's OnTriggerEnter2D

$
0
0
I'm having a little trouble wrapping my head around this problem..

I have a base health class that has virtual methods, such as a Damage() function that both the player and enemies inherit from.

I set up this projectile that, when it hits the player, it calls the player's Damage() function that's been overridden in the player's health manager class, and it damages the player according to what I pass into that function when it's called inside the projectile's OnTriggerEnter2D. That's...

Specifying player's damage in enemy's damage function inside enemy's OnTriggerEnter2D

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>