|
Post by drongophat on Aug 16, 2018 9:09:35 GMT
does anyone know of anyway, to add health to horses from horse anim pro set.
so for example. my character is riding horse and being shot by AI.
because currently even when i get shot whilst riding horse there is no damage dealt, and the player becomes invincible.
|
|
|
Post by drongophat on Aug 18, 2018 5:00:25 GMT
Answering my own question here. so i figured a way and it seems pretty straight forward when done.
Steps: - theres a pre existing box collider on horse already i believe, but add more on colliders to main object(horse) and place them so theyre flush with head & Body
- add "v health controller" script to the horse and make it so your enemies detect tags and can damage layers appropriate to the horse prefab.
- disable the health controller until player comes into contact with horse and is riding, i found you can do multiple ways through "V simple Trigger" script.
- then in your "v health controller" script in the events tab, in on dead set these: open two panels drag player into panel and set "rider3rdPerson.Start_Dismounting" & "rider3rdperson.end_dismounting"
- you can play death animations of horse too by just opening another panel and dragging the horse prefabs animator and use. Animator.PlayInFixedTime(String) and type "Death 1" or "Death 2"
- annnnnd lastly add a "v destroy object" script and have what ever time you want that poor dead horse to disappear.
i admit. its not amazing. buuut it works, and the results are, your player should take a bit of damage, before your horse dies and then you are thrown off as if you jumped off. im sure from this you can mess around with it and have ragdoll happen aswell. but i wasnt having some issues with that. annnd thisll do for now.
hope this is of some help
|
|