edited September 2017 in ORK Support
Hi,

This is for a first person rpg game.
I was using my own move AI to have my fox enemy stand still and attack me when I am near. He just followed me without biting. I also used waypoints, and the fox just followed me without biting even with aggression set to "always".

However, I got the fox to bite and follow me via a c# animation crossfade script. I was unable find a "blending" script. But he does not play his barking sound. I am looking for a fix for that. Also when I run out of range, I got the fox to stop running around biting the air, but he does not stop when I am out of range, he slowly follows me and bites, which is better than him going all over the place I guess. I would rather use Ork's animation blending or crossfade settings, but I tried all of them and different animation layers and settings, and I cannot get the attack animation to play on any of my characters when using the waypoints or my own still spawn AI.


using UnityEngine;
using System.Collections;

public class foxBlender : MonoBehaviour {
public Animation anim;
void Start() {
anim = GetComponent<Animation>();
}
void Update() {
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1F)
anim.CrossFade("walk");
else
anim.CrossFade("bite");
AudioSource audio = gameObject.AddComponent < AudioSource > ();
audio.PlayOneShot ((AudioClip)Resources.Load ("FOX SOUND BITE"));
}
}


However this code made my entire zone laggy. So I removed it.

AudioSource audio = gameObject.AddComponent < AudioSource > ();
audio.PlayOneShot ((AudioClip)Resources.Load ("FOX SOUND BITE"));


So I took it out and the fox bit me and followed, but no barking sound.

edit: i did the animations for some Goblins, it worked with attack sounds, on the warrior but not the caster, but it lagged up my scene, so I took it out again. The sound. Also, when using my own standing still move AI for them, standing in place ready to attack, they run in place. When two casters are casting spell effects on me, if I fight both of them at the same time, the spell effect keeps repeating on me even after they are dead. This does not happen with one fight of a caster. Also, when the goblins walk their paths, their animation flickers every few seconds to attack, then goes back to walk animation.

Note: I do not have all of these problems when using the regular Hunt AI when they roam around, but I cannot always use that. Especially in dungeons or tight places. Also, all of my scenes use scene music or scene sound effects of nature.

Please, any more help would be great. Thank you.
Post edited by silverglade1 on
  • The bite sound needs to be set up either in the attack the fox uses (e.g. in the ability's User Changes audio settings to play it on the user, i.e. the fox) or just played in the battle event used to animate the attack.

    Also, your animation blending uses player input - i.e. not really what you'd need for an NPC combatant like a fox.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited September 2017
    Thank you. How can i play the fox bite attack? I tried it with Ork settings and he would attack with no bite. The same thing with the goblins. Also I dont know why my 2 goblin casters at once cause the spell effect to stay on me after they are dead. And the flicker when they walk to fight pose for a split second. I am sorry so many questions. After this i am sure this time i can just go off and make my game. Please. Im almost done.
    Post edited by silverglade1 on
  • As I said - e.g. using the auto settings in the user changes of the ability. To use the same ability for different combatants (playing different sounds), you'd use a Sound Type and set up the sound effect for that sound type in the combatant's setup.

    Status effects aren't removed when the caster of the effect dies. Flicker could be an animation issue :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited September 2017
    Thank you GiL. So much!!!

    edit. ok. I am getting very close.I finally, after weeks, ditched the fox into the virtual toilet. I'm not using him he's too bugged. I replaced him with a nice hyena prefab animation. Works perfectly, better, prettier. sometimes I just have to accept that some things should not be used because of general bugginess.

    7pm update.

    ok, I set up a goblin ranger, mage, and warrior...the problem was the prefab. The fbx file. I had to set the wrap mode to loop then remake the prefab, and all problems solved except my grunt sounds for the goblins have some silence in them that are not playing out. it loops it too fast. and ignores the silence.

    edit: 9-13 wed...I put a bunch of child, female, and male villagers moving around via waypoints, and some standing still. their sounds are perfect, the attacks are good. the children are perfect. It took some work but I managed to use an animation that moved the legs as the other walk did not work. so their legs moved. One woman model refused to move her legs, so I did not use her in the end. I'm fine with that. I have another. finally perfect characters. Like I said though, it takes a little creativity to get these character prefabs to work correctly.

    here are some screenshots of a lower level im making in game. i have 30 of these levels LOL. going to take like a year to finish this game. but fast once i finish this scene with initial proper animations. Any more ideas you have to help would be great if you can..about my grunts looping too fast on the gobIins and not playing my silence parts of the loop. pretty much, can go make my game after this help, I HOPE,

    image
    image
    image
    Post edited by silverglade1 on
Sign In or Register to comment.