Doing a flocking algorithm
I am attempting to do a flocking algorithm for my game and was given a sample piece to finish if I wanted to use it. The problem is that I have seen several examples of flocking algorithms on the...
View ArticleProblems with Enemy AI
This question will probably solve itself as i search through out the internet but ill give it another shot. So this time, my problem revolves around a Entity that i want to make in my game. This...
View ArticleEnemy Spawn waves, not stop keep looping
I am being trying to create a space shooter game for a while now, right now i trying to create a enemy spawn script from a video i see on youtube, now this script keep loop or restarting for first...
View ArticleProblem with Enemy AI
This question will probably solve itself as i search through out the internet but ill give it another shot. So this time, my problem revolves around a Entity that i want to make in my game. This...
View ArticleEnemy projectile direction setting
Hey everyone. I've run into an issue with using "Turret-type" enemies in a simple 2D game, programmed to fire a projectile based on the direction and rotation it's currently in. The problem is that...
View Article[C#] Respawning system Enemies
I am making a game where once you kill an enemy, two more respawn and you score is based off of that. So far it was working for the first 2. I killed the first enemy, so it spawned two more but once i...
View ArticlePush back an enemy on trigger
I have two gameobjects, one of them is my "hero" an the other one the enemy with a NavMesh, I've managed to make the health system without problems but know when the sword collides with the enemy it...
View Article2D Enemy movement HELP
I want my enemy to move when the game starts ,and changing direction after few seconds so it wont fall.I use this code put it doesn't work ,it change direction only once: void Update() { if (Time.time...
View ArticleHow do I make it so a death animation will play when I hit an enemy?
Hi guys, I am working on a 2d infinite runner game, and I don't know how to play a death animation when I hit an enemy. I added a 2D box collider and a 2D rigidbody, but I don't know how to make it so...
View ArticleScript bug (gameObject.tag)
Hey! So I have a script so that the player loses health on a collider. It worked well however, it worked on every single collider and I do not want that. So I added an IF statement saying it should...
View ArticleEnemy AI Error
Hey guys. I'm having a problem with my Enemy AI moving towards my player. It keeps saying "Object reference is not set to an instance of the Object". Think anyone can help me fix it? My code is this;...
View ArticleMake object move in a direction depending on where it spawns? (C#)
Hello! I have some enemies that I would like to "glide" over the screen using transform.translate, the only problem is that I'm not sure how to do this because I spawn out the enemies at a random...
View ArticleObject moving too fast, so that the collider does not work (C#)
Hi! I just found out a problem with my game, I've created an enemy that "fly's by" the screen in order to hurt the player, but the problem is that the enemy moves to fast so that the collider doesn't...
View ArticleEnemy Isn't Hurting Player in Survival Shooter
Hello! I am trying to follow Unity's Survival Shooter tutorials, but can't get my enemy to hurt the player. It will follow, but won't hurt the player when he attacks. When I got to [phase 7][1] and...
View ArticleAttaching objects to scripts without dragging and dropping
I'm working on a game and I'm currently stuck with trying to get objects and scripts attached without dragging them into the inspector. Basically I have enemy prefabs that start spawning on Start ();...
View Article.SetActive (false) deletes gameObject but it's effects still affect the player
Hey guys, I'm having trouble with .SetActive (false) to disable some instances of game objects. I was following the Roguelike Unity tutorial (whilst making tweaks for myself) and realised that when...
View ArticleEnemy Spaceship Movement AI Curve Movement Need help Please
I want to know how i can go and make a curve movement, by using sin and cos in not getting to understand it at all. the type of game a i am making require it so i can the enemy to come in with...
View ArticleRegional Enemies?
I want to create enemies that can only move within certain spaces, but in this space they can move wherever they want. How would I do this? What would the script look like, as I'm pretty dismal at coding.
View ArticleMore than one enemy?
I have a wolf, when I damage that wolf, it's health ticks down by 20, when I kill that wolf, the wolf despawns -- it works. However, if i spawn a second wolf, then I kill the first wolf, the second...
View ArticleThe type or namespace name PlayerHealth could not be found (are you missing a...
Hi so I'm just started using unity and saw a tutorial on youtube on how to make a zombie FPS and when I use PlayerHealth for an enemy attack it gives me the error in the title. Here's my code, using...
View Article