I am trying to code different triggers so that some triggers will only affect certain characters. For example, the water character will evaporate(die) in fire/lava, and the fire character will extinguish(die) in water.
I was planning on making different triggers for each element so that they affect other characters differently. Although I have a plan, coding the triggers to react differently to each character is new to me. While I am familiar with C++ and Java, this is my first project using C# and coding in Unity.
My coding plan is to set a public variable to a different char/int value per water/fire character, and then have it that if the public variable == [insert appropriate value] then the character will die. The problem is I do not know how to format or code that, as I’ve just copied the sample code for triggers from Unity’s Sample 2D platformer.
Could someone give me some tips/guides/sample code/etc?
A better place to start on your general scripting adventure is the Getting Started forum. There’s also plenty of tutorials to go through on the Unity Learn site.
Gotcha, and l am actually watching some of those tutorials rn! Although, it might be a while before I reach to where I need and this is for a college project, so I will post this in the Getting Started forum if I still need help! Thanks!