How to find a group of enemy in unity
Hii there, I made a game i added enemys in it , so now i want to find a group of enemy in game scene . Can some one help me plz. Thanks :) ,Hii there, I made a 2d game i added enemy in it , so now i...
View ArticleWhy my Player jumps after the enemy has died?
I made a code for killing enemies jumping on them, like in Super Mario, but my Player jumps when he touches the ground, instead of the head of the enemy. This is my code for the enemy: using...
View ArticleIs there any way I could make the enemy chase the player when detected if I...
I have this script: public class RandomMovement : MonoBehaviour { public NavMeshAgent agent; public float range; public Transform centrePoint; void Start() { agent = GetComponent(); } void Update() {...
View ArticleWhat am I missing for the enemy aggro script? My script is below and I know I...
using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyFollow : MonoBehaviour { private void OnTriggerStay2D(Collider2D collision) { if ("Player" ==...
View ArticleHighscore doesn't work
Trying to make a game where every enemy killed gives a specific number, and I wanna implement a highscore Please help Score Script: public class ScoreScript : MonoBehaviour { [SerializeField] Text...
View ArticleHighscore not working
Making a game where every enemy killed gives a specific number, and I want to make a highscore Please help Score Script: public class ScoreScript : MonoBehaviour { [SerializeField] Text score;...
View ArticleBest way to apply character effects to many enemies?
I want to apply effects to a decent size number of enemies, like burning, slowed down, poison, and I worry about performance. At the moment I am creating this using a different particle system for each...
View ArticleHow can i stop the enemy jitter when it follow the player?
Hi folks! I have been working on the enemy script from 2 days, and unable to solve this issue. I have write a code where the enemy(object) can follow the moving player. I had also added distance limits...
View ArticleHow to Freeze an Object on Raycast
EDIT: Sorry for the double post, I made a mistake with the previous post. Hello. I'm trying to make a mechanic for my FPS where the player presses their primary mouse button and the resulting Raycast...
View ArticleHow to make Object1 check if Object2 has been destroyed? (in c#)
I am working on a little game where in one Level there are multiple enemies with the Tag "Enemy" and I want the player to check if every enemy has been destroyed and if yes it should change to another...
View ArticleI need help with making a score system where You kill enemies to get points
I made a top-down 2D shooter where a player should **get score by killing enemies**. I was planning to further turn score that was earned into coins which can later on be used to buy other guns,...
View ArticleHow do I make it so I only damage the enemy once?
I recently made a pretty simple FPS game, where you shoot bullets (which are gameObjects) at enemies. I made it so that each Bullet does 5 damage, and that the Enemy has 50 health. So it should take 10...
View Articlescore not going up when i kill an enemy
i'm trying to make a score text that goes up whenever the player kills an enemy but the text wont update from zero i have created a public text in an enemy prefab and as text i've also used a prefab...
View ArticlePlayer taking "2 hp" damage instead of 1
hi, i wanted help with damage, so i just made a simple script, it's just an image which damages the player when collides with the player, but for some reason the player takes damage of 2 hp instead of...
View ArticleScript conflicting with another
Hi, im making a enemy AI script, and, i have an follow method, that make an enemy follow the player, when he is close, but, if i add another enemy with the same script, it work like an hive, i have to...
View ArticleI want an enemy to take damage from a projectile (A Certain Layer Named Bullet)
So I added damage and health to the enemy but i dont know how to make him get damaged from a certain projectile here's the code public void TakeDamage(int damage) { health -= damage; if (health <=...
View ArticleI want my bulletHole to not appear when its an enemy but it isnt working
if (!gameObject.CompareTag("Enemy")) { GameObject bulletHoleToSpawn = Instantiate(bulletHoleGraphic, rayHit.point, Quaternion.LookRotation(rayHit.normal)); bulletHoleToSpawn.transform.forward =...
View ArticleHow to stop enemies to go into each other?
hey guys, I am pretty new to Unity and tried to make a little game. There I made a quick Skript for an Enemy that is chasing the player. Thats the SKript I used: using System.Collections; using...
View ArticleI need a 2d Ai that chases the player that is fairly simple
Im working on adding ai to a game Im working on and I cant get it to work as I want and the ai's rotation and stuff is very weird. I want it to chase the player when in a certain radius and I deleted...
View ArticleGetting a variable defined in a void
I "borrowed" some code from the unity documentation trying to get an enemy to follow the closest player. My problem is that the closest Game Object variable is defined like this: `public void Example()...
View Article