Random enemy fire rate
Hello guys, I'm trying to make a school project (space invader) and I have a itty problem with my alien shooting I want them to shoot at a random rate, I more o less managed to do that I think......
View Article2D Enemy AI range problem
Hi, I am currently learning programming and making a 2D rpg game. I've encountered a problem which I haven't been able to fix for 2 whole days.. It's really getting to my nerves now and I can't find...
View ArticleHorde of NavMeshAgents - stops to recalculate path.
**PROBLEM:** I'm making a simple horde-shooter, where a big amount of Agents run towards a moving player. I've made a Navmesh through build-in Unity baker. All works well, but the problem is - on...
View ArticleHow can I make my enemy stay on the ground and collide with other objects?
In my script the enemy chases the player until it is close enough to attack, but they enemy doesn't stay on the ground and flies through walls. How can I make it obey gravity? here's my code: using...
View ArticleChecking 2DCollisions During a single Update
I have a weapon that launches a round and damage should only be dealt to enemies within it's Collider2D when it impacts the ground. What's the best way to deal with this? What I have now is as follows....
View ArticleGameObject.Find doesn't work globally. If I put it inside a function it...
var enemyUnit = GameObject.FindGameObjectWithTag("Enemy"); var enemyAIScript = enemyUnit.gameObject.GetComponent(EnemyAI); function Start(){ alert = false; caution = false; normal = true; } function...
View ArticleAttacking enemy only hits one at a time instead of all that have been hit
I am trying to kill a mob of enemies that are coming at me at once. I summon a skill which hits all enemies around it. The skill and scripts work just fine except that the skill only hits one enemy at...
View ArticleFloating enemy objects?
void Patrol() { RaycastHit rayHit; if (Physics.Raycast (transform.position, Vector3.back, out rayHit, 10.0f)) { if(rayHit.collider.tag == "Player") { playerSpotted = true; } } moveDist = speed *...
View ArticleUnexpected token: position?
Hey Guys, Im new and am confused why im getting this message in unity "Unexpected token: position". Any help is appreciated! Thank you~ #pragma strict var nextLevel : boolean; function Update() {...
View ArticleHow can I make my player only target objects from a certain distance?
Right now I have some scripts that allow the Enemy to die, and when he dies you get XP, and I tried adding some more Enemies, and implemented a targeting system, but you can be any distance. You can be...
View ArticleHoming missle with raycast
hi i have been learning scripting and decide to try to make a lock on missile so Ive been looking and all the tutorials have a script that just look for the closest obj with the tag enemy and etc but...
View ArticleHow to make enemy speed up
I made a gravity runner game but I want the enemy to speed up in the beginning because he starts outside of the screen, any suggestions? Here is my code: using UnityEngine; using System.Collections;...
View ArticleStopping a bullet but letting the animation continue
Right now I have a major hiccup in my game. I have a code running so that a "Bullet" shoots from the whale and when it collides with something it stops. This is exactly what I want, except when it...
View ArticleRotating Wrong
when the AI moves towards me it rotates forward for some reason, same as when it sees my player if I move it'll tilt the model forward a little and then when he chases me it doesn't work very well it...
View ArticlePreserve data within a scene
I'm making a game (specifically a top-down shooter) where there is a main area and several sub-areas saved as separate scenes. This has lead to a problem: if I kill an enemy in the main area, going...
View ArticleRandom Enemy 2D C#
Hey guys. I have a problem with my code. I want to make an enemy that it can show up everywhere and when I click that I get a poin, and the problem is when I run it the enemy doesn't show up. I thing...
View ArticleMake my enemy stop when he reaches me.
This is my EnemyAI script its just for some zombies, they don't attack its for a scary walkthrough type of thing. Its just that they get on top of the palyer and then block the players view from the...
View ArticleHow to get a enemy to flip at a certain point
I'm making a 2D side scroller game and I have this one bit where you have to jump across this lake on lily pads and there are sharks in the water. All you can see is their fins, I have got them moving...
View ArticleHow to keep an Enemy from teleporting outside of a room.
Simply put, there is an enemy within my game that has the ability to teleport, but what I want is for it to randomly teleport within a certain range, and also make sure that it does not teleport itself...
View ArticleEnemy ignore player if object blocked his sight
Hi ..... how to let enemy know there same thing block his sight to see player im using "vector3.angle" to make enemy sight
View Article