Hey all. I have my real time battle system setup. I must be missing something. I have bears in the forest that attack the player when they see him. Problem is if the player is behind them and attacks them first, the bear attacks facing away from the player on its first attack, then turns around toward the player for the rest of the battle. How can I make it so the bear turns toward the player first, before it attacks and stays facing the player? Oh, and I can't get sounds to play on the bear, either. If I try to set a sound in the bear combatant, it plays when the player attacks, not the bear. Thanks!!:)
  • If you're using battle ai to get the bear to attack you could try using a rotate to target node before the attack node. Are you using battle events to play sound on the bear?
  • edited April 2019
    @FreedTerror the tutorial turn based battle event is still in there. What I did was copy some stats from the player and made the bear. Maybe making a new battle event is the way to go? I should probably get rid of the tutorial battle events. Lol.
    Post edited by Sierota1701 on
  • Probably just make a new battle event. I don't know what kind of sounds you're trying to play. If you're doing attack sounds, like when the player swings a sword. You can make a new battle event that just plays your attack sounds. Then in a new battle event you can use a call battle event node to use your playsound battle event. This way you don't need to use a bunch of play audio nodes for every battle event.

    If you trying to play sound effects when hitting a target, that's a different story.
  • As @FreedTerror said, you can rotate to the target in the battle AI, or alternatively in the battle event used to animate your action. Probably better to do it in the battle event, or you'd have to rotate toward the target in each battle AI that uses the action :)

    The sound playing depends on which sound type you're setting it up for (and when it is used). E.g. if it's set up for a damage sound type, it'd be played when the bear receives damage (and it's set up in the ability/item that plays the sound).
    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!
  • Nice! Got some work to do tonight, then. Thanks guys!:)
  • edited April 2019
    I did that with mine. They rotate at the beginning of the battle event, and they rotate right before the attack (in case the player moved), also doing battle AI where they occasionally rotate towards the player helps too, otherwise in between events they will stare into space. Basically if they don't have an attack ready they will still face the player.

    For RT sounds I have an empty prefab with only a sound effect spawn on the combatants attack event, then delete itself right after the sound plays. (I prefer to set it on the prefab as an auto-play event Delete after X seconds so you don't have to have to rely on the battle event doing it.) I prefer this as it lets you easily control the volume, pan, 3d/2d effect, and location of the sound upon spawning.

    Also you can set collider effects too for damage zones and damage dealers so you can spawn blood or whatever else upon collision with the target. For instance I had a robot spawn sparks every time the damage zone was activated.
    Post edited by Wrofir on
  • edited April 2019
    Had no time the past few days. Thanks for helping me fix my problem! @Wrofir @gamingislove @FreedTerror You guys rock!
    Post edited by Sierota1701 on
Sign In or Register to comment.