GuardianTerra
New member
Emerald Ai code for damage.
Opsive code for damage.
Bullet prefab - add to it
Melee - animation that starts this code?
Explosion?
Damage(int DamageAmount, Transform AttackerTransform, int RagdollForce)
//Damages an AI to the YourTargetReference object
EmeraldAI.IDamageable m_IDamageable = YourTargetReference.GetComponent<EmeraldAI.IDamageable>();
if (m_IDamageable != null)
{
m_IDamageable.Damage(DamageAmount, transform, 400);
}
Opsive code for damage.
using UnityEngine;
using Opsive.UltimateCharacterController.Traits;
public class MyAIAgent : MonoBehaviour
{
[Tooltip("A reference to the Ultimate Character Controller character.")]
[SerializeField] protected GameObject m_Character;
/// <summary>
/// Damages the character.
/// </summary>
private void Start ()
{
var health = m_Character.GetComponent<Health>();
if (health != null) {
health.Damage(50); // Inflict 50 damage on the character.
}
}
}
Bullet prefab - add to it
Melee - animation that starts this code?
Explosion?
Last edited: