|
Post by Chronicman on Dec 9, 2016 21:40:56 GMT
I'm getting a issue with the sensor, If the player gets hit via rag doll and is within the sensor, all the rag doll colliders turn on and get added into the senor. Do they need to be tagged as player ? (the rag doll colliders )
|
|
|
Post by Invector on Dec 9, 2016 22:24:27 GMT
This happens because you still can take damage if the AI attacks you during the ragdoll period, otherwise you wouldn't take any damage. If you don't want this feature, just comment the line 152 of the vRagdoll script.
//c.tag = gameObject.tag;
|
|
|
Post by Chronicman on Dec 9, 2016 23:14:47 GMT
Humm I do not wish to remove that but remove the transforms from the list after words, Thanks Teles
|
|
|
Post by Chronicman on Dec 11, 2016 0:26:58 GMT
So I got it removing all the transforms after being hit via rag doll. I'm not sure if you guys wanted to keep or remove them when the player is out of range from the sensor. This is how I removed them from the v_AISensor: List<vCollisionMessage> targets = new List<vCollisionMessage>(); void OnTriggerExit(Collider other) { if (tagsToDetect.Contains(other.gameObject.tag) && targetsInArea.Contains(other.transform)) targets = other.GetComponentsInChildren<vCollisionMessage>().vToList(); foreach(vCollisionMessage c in targets) { if (targetsInArea.Contains(c.transform)) { targetsInArea.Remove(c.transform); } } targets.Clear(); targetsInArea.Remove(other.transform); }
|
|