Unity3D 5.2 Lose Health Collision (C# SOURCE CODE) @FusionDeveloper
Unity3D 5.2 Lose Health Collision (C# SOURCE CODE)  @FusionDeveloper
Uploaded October 2015 | Updated September 2026, 2 hours ago
// C# Unity 5.2. Reference and more details (set as trigger) from AkiUnity3D @ youtube.com/watch?v=fSAwaop3Mg8

using UnityEngine.UI; //REQUIRED FOR TEXT on the Canvas TO WORK!

public int playerHealth; //This will be set in Inspector, to a number such as 10
public Text canPlayerHealthText; //This will be where you drag your
// canvas TEXT object onto the slot created on your Player in Inspector.
// If "Text" is underlined in red, then you forgot the using UnityEngine.UI; at the top of the program

void OnTriggerEnter(Collider other)
{
playerHealth = playerHealth - 1; //subtract 1 from player health
canPlayerHealthText.text = playerHealth.ToString(); //set the Text to the new player health
}



//OKAY HERE IS SOME MORE details, but using different variable names.
//On trigger enter.
//
//Setup in Editor:
//
//@Moving Object
// Add this class to the [moving object].
// Add a rigidbody to that object.
// Make sure {Gravity} = false.
// and {Kinematic} = false.
// Use a regular collider.
//@End GameObject
// Make sure the [end object] has a collider.
// Set [end]'s {trigger} = true.
//
// This setup makes [movingObj] collide with walls and stuff (as usual)
// However, the endObject is a trigger, which means stuff can move through it,
// but an event is still sent.
//
// When the [movingObj] hits the trigger, OnTriggerEnter is called.
// The parameter, [other], is the collider script of the end object.
Unity3D 5.2 Lose Health Collision (C# SOURCE CODE)◙ Alternative to sifting mealworm pupae. Separate while still worms instead.Mealworms not impressed by carrot peelings.Improvised pseudo UV light filter using tinted plastic from sharpie markers (no talking)slug repelling down a line of slimeclickteam fusion 2.5 chocobreak tutorial 1 step11 better instructionOrcs Must Die Unchained: Baths (How to)Mealworms getting excited over freeze-dried crickets.vermicompost finishedBook Lice? Several people have agreed they are. Either way, Im not putting them in my terrarium.How I raise Mealworms. Part 001 (60 fps)Chris Pirillo jingle bells for christmas 9 at once!
Fusion Developer |

Unity3D 5.2 Lose Health Collision (C# SOURCE CODE)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER