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 'issues w/ buildings'.



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 1 result

  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; } } }
×
×
  • Create New...