How can I randomize the speed of enemy movement?
How can I edit the following script so my enemies follow the player at a random "moveSpeed" between 5 and 10? var target = GameObject.Find("aggro").transform; //the enemy's target var moveSpeed = 10;...
View Articlespherecast wont work
var enemyNearing: RaycastHit; var start : Vector3 = transform.position; if (Physics.SphereCast(start, view, transform.forward, enemyNearing, 0.000001) && enemyNearing.transform.tag ==...
View ArticleProblem while creating enemy
I am new to unity and working on FPS game, What i am doing right now if my main character is entering a new room randomly enemy will be created in range 1-4 , suppose 3 enemy created in new room. Iam...
View ArticleAI Enemy Follow de player with wayPoints
Hello everyone, I'm making a game like PAC MAN. I already have a script that will be the basis of Intelligence of my enemies. The script below is the player with some bugs, my enemy does not follow the...
View ArticleWhat are some good way to move enemy randomly in environment.
I am working on FPS game and i want to know about enemy movement in environment, i want to move them randomly and i want to know what are good way to move enemy randomly in environment so that it...
View ArticleProblem with random spawning and coroutine
Hello everyone. I'm actually pretty a newbie at coding, and I'm trying to figure out how to spawn a prefab randomly picked every x seconds (i've made a public float, so I can test the timing directly...
View ArticleUnity 2D Platformer Enemy doesnt flip c# HELP PLEASE
Hi folks, im doing a 2d Platform enemy patrol that go from left to right (c#) , and i need to make him face to the correct direction, so Im using Flip() function (-xScale), but the sprite keep in the...
View ArticleWhen EnemyCount reaches 0, Load Win Screen
Ok so I'm running on some major BULLSHIT. I'm trying to make that when you kill all enemies, the Win screen loads. I have 10 enemies in the level, but for some unexplainable reason, that number just...
View ArticleMoving character from point to point
Hey Unity Heroes, I've been searching and searching for a way to move a character from point to point, but I can't seem to figure out how to actually get it done. I've seen it done by Lerping and...
View ArticleEnemy rotation issues - Javascript
In the game that I'm currently making, my enemy is supposed to fly towards the player and follow them. I've got the ability for the enemies to follow the player, but when they turn, they're turning on...
View ArticleApplyDamage Error
I am trying to get my MecaAnim character to attack my player, so far ive got it to work but the problem I cant figure out is that im only getting damaged when im behind the enemy.. help please lol...
View ArticleEnemys Health
I have a small issue here, that is driving me mad. I have read dozens of posts and tried each technique, but to no end. The problem is, when my turret ability triggers the function, damage is done to...
View ArticleBug with my enemyAI
I got a simple basic enemyAI script of the unityanswers, and i need some help with it it is for a First Person RPG Adventure game i am working on. When the enemy chases you lose health, (heaps of...
View ArticleSpawning enemies javascript
I have enemies spawning randomly in few positions. My problem is that sometimes when you kill one of them, another spawns in exactly same position without any delay at all, so when you think you have...
View ArticleEnemy line of sight
I'm having trouble with raycasting! Basically, my enemy has a sphere collider I'm using as its maximum sight distance, and when the player enters this, it tells the enemy to chase the player. That part...
View ArticleEnemy follows the only player in rotation
2d game. My enemy is following me right and left, but when I jump, the enemy turns to me. I would like to jump when the enemy stands still while they are not looking up. How can I fix? Script that I'm...
View ArticleMultiple enemy prefabs moving towards a single goal. Need help!
Here is my code to move my enemies: void FixedUpdate(){ Vector3 targ = goal.transform.position; // Get a direction vector from us to the target dir = targ - bombSpawner.transform.position; // Normalize...
View ArticleMultiple Enemy Collision Help
Hello, I am making a sword game, and I have an enemy that I want to kill the player. I have a working AI script, but when I tried to make an attack script, I failed. I want it so when you collide with...
View ArticleJerky velocity movement
Hi I'm making a vertical scroller 2D game that contains a crow as enemy that flies directly to the position the player is residing at. The crow is a prefab that is instantiated in a game pool at start...
View ArticleEnemy not colliding
So what I have here is enemy AI where the enemy chases the player when the player gets a certain distance from them and attacks when the player is close. While it is working how I want, the enemy is...
View Article