Random enemy generator
Hello, *Excuse my rusty English I'm creating a 2D Game and trying to create a random moving enemy, and the code works fine in small numbers.. but when i enter more than 50 enemies the game become very...
View ArticleEnemy AI Patrol Points Array Index Out of Range?
I made a script to get my enemy to patrol between three different spawn points. It works, but when he reaches the third spawn point, even though he keeps going it gives me an Array Index out of Range...
View ArticleEnemy Script Error
I have an error that keeps popping up, and I don't know why it says its a phrasing error but it shouldnt be. Here is the script and a photo ![alt text][1] using UnityEngine; using System.Collections;...
View ArticleEnemy not moving
I just fixed one error now there none but when i hitplay enmy dosent move so i dd a rigbody and it still dont move here is a photo of me by the enemy aand its not moving and also i included the script....
View ArticleEnemy Health Bar
i got this piece of simple code that works very well. var hit = 0; function OnTriggerEnter (other : Collider) { if(other.gameObject.tag == "Bullet") hit +=1; checkhit(); if(other.gameObject.tag ==...
View ArticleHow to make Enemy grab the Player with animation?
Hi guys , I'm a beginner in C# and I can't figure out how to attach two game objects with each other using animations, just like a zombie grabbing the player with animation and we need to press buttons...
View ArticleGetComponent for a stored transform.
Hi, Im making a tower defense game but ran into some problems with my tower. When an enemy enters the tower's trigger, it stores their transform. For the tower's bullet that it instantiate, I want to...
View ArticleSpawning Waves: Second wave doesn't start?
Hey everybody, I'm almost brand new at this. My issue is, once the first wave of enemies are defeated, the second wave never begins. I'm using the first tutorial from the Unity Game Development...
View ArticleInvokeRepeating is not stoping.
I am trying to make enemy spawn using InvokeRepeating but any how i am not able to stop it when i have enough number of enemy Here is the code can any one tell me what went wrong. public GameObject...
View ArticleAll enemies die when one does
I'm having a problem with the scripting in my game. When I jump on one enemy to kill it all the enemies die. They were all dragged into the scene view from a prefab. Here is the script on my enemies:...
View ArticleEnemies won't attack after they spawn!
I am trying to make my enemies attack my player after they spawn but they just run towards the player, stop, and don't attack. I am making the spawner use the enemy prefab, but when I actually place...
View ArticleKeep track of every time an int changes, including what the value is each time?
What is a good way to do this? I need to keep track of the players position every time he changes direction so my enemy ai will work.
View ArticleHaving game objects be parented is making them unmoving.
Hello, I am trying to make a game that is forward moving rail shooter similar to star fox. The setup I am trying to have is the parent game object that hold the player character in it and the enemies...
View ArticleWhen one enemy is affected, they all are...
Basically I understand why this is happening, with me using public static variables. When you shoot or kick an enemy in a specific place it's switched out with another version which is damaged... I'm...
View Articlecharacter controller does nothing, and model teleporting
void FixedUpdate() { Vector3 deltaPosition = target.transform.position-transform.position; if(deltaPosition.magnitude < 50) { if(deltaPosition.magnitude > 7) { playAnimation("Walking");...
View ArticleHow to tell which enemys to create in new battle scene
Hey, I'm working on a turn based combat system. The idea is nothing new you walk along and touch an enemy's collider which triggers the battle arena (-> new scene). Now I am wondering how can I tell...
View ArticleEnemy follow Camera
I've got the following script attached to the enemy to make it move towards the camera: using UnityEngine; using System.Collections; public class EnemyMovement : MonoBehaviour { Transform player;...
View ArticleMecanim Enemy AI Script help???
I searched and searched and found similar unanswered questions. I would like to use the Mecanim to animate my AI. I have an AI script but its not working. I found this script and changed what the enemy...
View ArticleSpace Shooter Hazards Not Spawning
Upon completion of lesson 15: ["Counting Points and Displaying the Score"][1] I ran into an issue with my project. For reference I am running Unity version 4.6.2f1 Hazards no longer spawn upon starting...
View Article2.5D enemy-player tracking script does not work.
Because I don't know how to use the vector.dot thing, I made a roundabout method. There is a secondary part of an enemy that watches the player, and will change the direction of it's parent depending...
View Article