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 'navmesh'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • 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

Categories

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 9 results

  1. hi,how can i use agent OffMesh link,when Agent on the StartPos Wait a little and jump down ,then resume agent. IEnumerator jumpdown() { OffMeshLinkData data = agent.currentOffMeshLinkData; Vector3 startPos = agent.transform.position; Vector3 endPos = data.endPos + Vector3.up * agent.baseOffset; float normalizedTime = 0.0f; if (agent.isOnOffMeshLink){ while (normalizedTime < 1.0f) { Anim.SetBool("Jump",true); float yOffset = height * 4.0f * (normalizedTime - normalizedTime * normalizedTime); agent.transform.position = Vector3.Lerp(startPos, endPos, normalizedTime) + yOffset * Vector3.up; normalizedTime += Time.deltaTime / duration; yield return null; } } }
  2. Here is a pretty simple ZombieAi Script i made to make use of Unitys NavMesh It should be pretty easy to set up ( your player should have be tagged as: "Player" and you might also want to change the line where damage is delt to fit ur project)
  3. Hello, I want to limit the AI to something like this How would I do something like that? I have no clue how to limit it like that. I want the red to only be able to move inside the painted red squares, and blue inside the painted blue squares Anyone have any idea how I would do this? If there's some important information I missed, please tell and I'll add more information
  4. so i have a multiplayer game with about 4 players in each session, but A LOT of enemies. All enemies have a navmesh agent . Whats the best way to sync all the enemies positions with all the players without causing anylags? i am using photon network.
  5. Hello people. This is a Simple enemy Ai using Navmesh for navigation. I have written in the script, what the the different things do, so its easy enough to find out what the AI does. The only thing you need to do is to place the script on your AI. Add the (Nav Mesh Agent) component to your AI, and set the (Nav Mesh Agents) stopping distance to 2, and you are done. ////////////////////////////////////////////////////////////////////////////////////// /// /// /// /// /// AI Script Written by mikkel1265 /// /// /// /// /// ////////////////////////////////////////////////////////////////////////////////////// var Distance; var Target : Transform; var lookAtDistance = 25.0; //when the AI starts to look at the player var chaseRange = 10.0; //when the AI starts to chase the player var attackRange = 2; // when the AI stars to attack the player var moveSpeed = 4.0; var Damping = 6.0; var attackRepeatTime = 3; var TheDamage = 20; // how much damage the AI gives private var attackTime : float; var gravity : float = 20.0; function Awake() { Target = GameObject.FindWithTag("Player").transform; } function Start () { attackTime = Time.time; } function Update () { Distance = Vector3.Distance(Target.position, transform.position); if (Distance < lookAtDistance) { lookAt(); } if (Distance > lookAtDistance) { //renderer.material.color = Color.green; // if you want the AI to be green when it not can see you. } if (Distance < attackRange) { attack(); }else{ } if (Distance < chaseRange) { chase (); } } function lookAt () { //renderer.material.color = Color.yellow; //if you want the AI to be yellow when it have spottet you. var rotation = Quaternion.LookRotation(Target.position - transform.position); transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * Damping); } function chase () { this.GetComponent(NavMeshAgent).destination = gameObject.Find("Player").transform.position; //renderer.material.color = Color.red; //if you want the Ai to be red when it are chasing you. } function attack () { if (Time.time > attackTime) { Target.SendMessage("ApplyDamage", TheDamage); Debug.Log("The Enemy Has Attacked"); attackTime = Time.time + attackRepeatTime; } } function ApplyDammage () // To give a effect thet the AI have been hurt, so it lose movespeed, but it are angry at you so it want to catch you. { chaseRange += 5; moveSpeed -= 1; lookAtDistance += 5; } The AI helath/damage is in another script and thats just a simple if (health <= 0) Destroy (gameObject); script, but if in some way you want it just pm me. Its my first script i post here, so i hope you like it.
  6. 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; } } }
  7. Hey Guys, I've done the basic NavMesh movements to a static target, now how can i make that into a roaming thing ( my idea is - after spawning AI's they'll roam around in the maze for a random time based on a timer then go to the target ) somewhat like Pacman Ghost, So any idea how to archive this ? Thanks in advance
  8. Hi, I have an enemy that uses root motion, and has a nav mesh agent, how would I covert the root motion to nav mesh agent speed? Is it possible? Or should I be doing it another way? Thanks.
  9. Im making a game using the fps kit 1.3.5 and I saw this thing called nav mesh for npc navigation in unity. Is there any way I can use this to make the zombie AI avoid obstacles? Thanks
×
×
  • Create New...