Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'enemy ai'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase


  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL





YouTube URL

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 2 results

  1. i have it so the navmesh "Controller" makes the game-object go to the player if they are in range(The player is selected by closest player, can change on update if another player is closer). then if the enemy/gameobject get close to the player the Controller will stop the navmesh, and the gameobject/enemy will start playing the shooting animation. but i have one main issue. The enemy stops even if he can not see you(Like if you are in a building) should i just have two types of enemies, being one is for inside only and the other is for outside only? or is there a way to check if view is obstructed? example of obstructed view: https://www.dropbox.com/s/ctucw3yu4csxhhr/Screenshot%202015-07-06%2020.41.30.png?dl=0 Example of normal: https://www.dropbox.com/s/38bj2z5avqoqbw3/Screenshot%202015-07-06%2020.41.00.png?dl=0 My current code: using UnityEngine; using System.Collections; public class enemyMovement : MonoBehaviour { float distance = Mathf.Infinity; GameObject closest = null; public Transform destination; public GameObject[] Possibledestinations; public GameObject[] HidingSpots; private NavMeshAgent agent; int index; public float DistanceToTar; public string StandingAnim; public string MoveingAnim; public string StandAttackAnim; public GameObject Anim; float curDistance; Vector3 diff; void Start () { agent = gameObject.GetComponent<NavMeshAgent>(); Anim.animation.wrapMode = WrapMode.Loop; Anim.animation.Stop(); //agent.SetDestination(destination.position); } void Update() { Possibledestinations = GameObject.FindGameObjectsWithTag("Player"); index = Random.Range (0, Possibledestinations.Length); //if(destination == null) //{ //destination = Possibledestinations[index].transform; //agent.SetDestination(destination.position); //print (destination.name); //} //agent.SetDestination(destination.position); //HidingSpots = GameObject.FindGameObjectsWithTag("HideSpot"); Vector3 position = transform.position; foreach (GameObject item in Possibledestinations) { diff = item.transform.position - position; curDistance = diff.sqrMagnitude; DistanceToTar = curDistance; if (curDistance > 5858.398) { Anim.animation[StandingAnim].speed = .4f; Anim.animation.CrossFade(StandingAnim); } if (curDistance < distance && curDistance < 5858.398) { closest = item; distance = curDistance; agent.SetDestination(closest.transform.position); } } if (curDistance <= 383.7049) { agent.SetDestination (closest.transform.position); agent.enabled = false; Anim.animation[StandAttackAnim].speed = 1f; Anim.animation.CrossFade(StandAttackAnim); } if (curDistance > 383.7049 && curDistance < 5858.398) { agent.enabled = true; agent.Resume(); agent.SetDestination (closest.transform.position); Anim.animation[MoveingAnim].speed = 1f; Anim.animation.CrossFade(MoveingAnim); } if (curDistance > 5858.398){ agent.enabled = false; } } }
  2. jackcrosa

    Enemy Ai

    I have a model with a couple of animations , how can i make an enemy ai out of this , thank you
  • Create New...