Hi I m trying to create some AI system with RAIN AI.
for this i need to change values of different variables
i want to change value after detecting collision in this case. i want to change health from
health of 100f to health of 5000f
using UnityEngine;
using System.Collections;
using RAIN.Core;
public class Health : MonoBehaviour {
public float nastroj=10f;
public float health = 100f;
private AIRig aiRig =null;
// Use this for initialization
void Start () {
aiRig = gameObject.GetComponentInChildren<AIRig> ();
}
// Update is called once per frame
void Update () {
aiRig.AI.WorkingMemory.SetItem ("health", health);
aiRig.AI.WorkingMemory.SetItem ("nastroj", nastroj);
}
void OnCollisionEnter(Collision collision)
{
aiRig.AI.WorkingMemory.SetItem ("health", health=2000f);
aiRig.AI.WorkingMemory.SetItem ("nastroj", nastroj);
---->????health=500f;
---->???? return health;
}
}