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.


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by KrypTik_Sweller

  1. Thanks man, i legit had no idea these few years i have been doing this how the hell did i not know that.
  2. Thanks, aparently i have been using unity wrong literally my whole life. I legit would wonder for hours why the mesh was fucked up
  3. the photo in blender is just after i modeled it the photo in unity with the messed up mesh collider is after i exported it, the last photo is what i want it to look like. someone please explain why it does this or at least what i'm doing wrong, ignore the last one only showing the blue lines
  4. well, it did once, it is supposed to turn(enable navmesh) every time it cant see the player, then it would print it again. but it doesn't. it acts like the raycast only shoots once, or something.
  5. but its not an if statement? also what is lookray
  6. if the player is not hitting the line, it should reactivate the navmesh untill it does hit the player correct? btw i did a bit of testing and it only showed up in consol once.
  7. so i have this: RaycastHit fwd; Physics.Raycast(transform.position ,transform.forward, out fwd, 1000f); copyis = fwd; if (fwd.collider.gameObject.tag == "Player" && curDistance <= 383.7049){ agent.SetDestination (closest.transform.position); agent.enabled = false; Anim.animation[StandAttackAnim].speed = 1f; Anim.animation.CrossFade(StandAttackAnim); }else { if (curDistance > 5858.398){ agent.enabled = false; } else { agent.enabled = true; } } it is in the update section, so shouldn't it always be looking at the player/and have a view of the torso of the player? because it doesn't really work, i can post a video showing the whole script and what happens in-game. btw idk but it was actually moderately working earlier. idk what i did, i changed nothing effecting this, lol.
  8. Thanks, i might try this out tomorrow, really tired
  9. i could just add a player tall trigger as long as the stop distance. and check colliding items that have the tag of barrier or building, if they do then i can enable the navscript.
  10. Should i use some sort of raycast? if so can you give me an example?
  11. 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; } } }
  12. Btw, thanks. I changed it to == and now it works fine. idk why i always forget to do the == and not the =
  13. I wanted to know why it was not assigning a target
  14. Would you mind telling me?
  15. the script assigns a destination if there is none.
  16. Yes i have the map baked, yes i have a script to control the navmesh agent, but he still doesn't move toward me or anything. Example with my code: https://youtu.be/0NaaTlgEiOc
  17. This is really cool, Only wish it was multiplayer
  18. we were talking about someone upgrading the kit, and how i didn't want to, not because it was not done for me, but because i didn't want to. also i don't know where to even start on an aircraft controller script, at all. that's why im asking. this is the only thing im asking for. not the entire game done for me. also this game is nothing like call of duty, or any popular game, not even close, it might have a 10% resemblance to destiny. but that's it. If you were apart of the "team" you would have sent me to a tutorial or sent me a script. that's what development teams do. when i joined armed unity, I expected nothing other than to share my work source, and get feedback on it. Not some one to make my game. Its one script, stop crying, not the hundred+ needed to make a great game
  19. almost no-one will see this post now, because someone already "answered it" and its old, so ill probably never get a reply.
  20. The grammar Nazi Was supposed to be slightly comedic. Sorry for going off, had a headache all day, took your post the wrong way.
  21. the kit for unity 5 also does not fit my purpose.
  22. the aircraft controller kit for unity 4 is not compatible, I imported it and it messed up the game.
  23. I don't expect it to be done for me, i didn't ask for it to be done for me. I don't want to upgrade because many on my other projects cant update without remaking them, plus I know nothing about GUI, also I'm not new, I have been using unity 4 for a wile, This kit is very simple to understand and modify or entirely remake into a new game. if you think that it is complex, you might need to find a new hobby/occupation. Honestly i would fully recommend this kit to beginners, if they cant understand it, they need to watch tuts, and try again, if still not, they also need to find a new occupation. Also you forgot a apostrophe in *that's
  24. none of the GUI is and i believe some scripts need changing.
  • Create New...