Search Unity

Question Need help finishing my game.

Discussion in 'Getting Started' started by bosspappi, Apr 21, 2021.

  1. bosspappi

    bosspappi

    Joined:
    Jan 1, 2021
    Posts:
    8
    I am trying to make my Character walk on a plane, not fall off the edges, and turn around, and avoid obstacles like walls, and to walk around aimlessly until the player approaches him to fight. My zombie has a Walk animation installed on him from Mixamo, (Mixamo is a website with animations you can upload to your character you made in Make Human. Org) I got my Character to stop repeating the walking animation he does, and spawning at the point where he started, by ticking the Loop Pose box . Using Bolt Visual Scripting I can make my Character walk forward, but only in one direction, while the zombie is doing the Zombie Walk animation from Mixamo. Can you help me make my Character walk on a plane, not fall off the edges, and turn around, and avoid obstacles like walls, and to walk around aimlessly until the player approaches him to fight, I am stuck right now.
    All I need to learn to do to finish my game is: 1. Make a Character move (and also walk around aimlessly) on a plane without falling off the edges, or turn back when he gets close to the edge of the plane. 2. My Character avoid obstacles like walls and cubes/rocks with the Navmesh Agent. 3. My Character follows the First Person Shooter Character Controller player when the player gets close to the Character to fight. That is it, these 3 things are all the things all my Character will do in the game. All the other complex animated movements I must animate myself in Blender 3D, and upload already complete animations to my Character from Mixamo. I must do the sounds effects, music, and other complex things like Character taking damage, and hit box for the Character myself.
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Create a NavMesh for your level.

    Write a script that will get a random position within the bounds of your level. Assign that position to be the AI's NavMeshAgent target. When they reach that point (or close enough to it) find a new point and repeat.

    Create another script that checks if it's within range of the player. If so, disable the script that's making them wander and move towards the player, performing attacks. If the element is too far from the player, re-enable the wandering script.