for this assignment, i did the boxed heart's script where the character would pass through it and it will refill his health. this is the script:
using UnityEngine;
using System.Collections;
public class Healthpickup : MonoBehaviour {
public GameObject target;
void OnTriggerEnter(Collider notMe)
{
if(notMe.tag == "healthpickup")
{
PlayerHealth.curHealth = PlayerHealth.curHealth +=100;
Destroy(notMe.gameObject);
}
}
}
and for the boxed heart itself, i simply created a box in maya and textured it. her is how it looks like.
and also i scripted the part where the dummy disappears after it dies.
No comments:
Post a Comment