health code help
I was programming this health code using System.Collections; using System.Collections.Generic; using UnityEngine; public class hurt : MonoBehaviour { public GameObject img; public GameObject img1;...
View ArticleHow do I get enemies to only chase me in certain areas
I'm am currently using a script that works fine at one moment and then the next moment certain enemies don't work while others do - I am confused void Update() { if(Antagonist.attackStage <=...
View ArticleMaking a Box Collider sword do Damage
Hi, this is my first question on here everyone. Sorry if my formatting is bad, and don't mind if the question is terrible new to 3d development. So I'm trying to make very simple sword combat in unity...
View ArticleIs there a better way to tell when enemies are dead?
void OnTriggerStay2D(Collider2D other) { if (other.gameObject.tag == "Antagonist" || other.gameObject.tag == "Skeleton" || other.gameObject.tag == "Wizard") { AllEnemiesKilled = false; } else {...
View ArticleMy enemy keeps shooting at me until I get close
Help, I am trying to make a code, where my enemy looks around for me, and then when he spots me, starts shooting slowly, but what ends up happening is from the start my enemy spam shoots me until I get...
View ArticleEnemy rigidbody and bullet collisions
Hello, as the title suggests, the enemies in my game have rigidbodies attached. Firing a bullet against enemies make them spin and bounce away (obviously, it's a space game and there's no drag at all)...
View ArticleWhy is my gameObject falling so slow?
I was testing out my own pathfinding script, and it worked, but only on the x axis, whenever the enemy falls, he falls super slowly, while all the other objects fall normally, could someone tell my...
View ArticleMy wave system isn't working
This is my wave system . using System.Collections; using System.Collections.Generic; using UnityEngine; public class Spawner : MonoBehaviour { private int waveNumber = 0; public int enemySpawnAmount =...
View Articlemy enemy isn't looking at the player in 2d
i'm trying to make a piranha that follows the player and i'm using a rotateScript for it to look at the player but when i try to set the coordinates for the piranha to look at the player it doesn't set...
View ArticleI changed my monitor resolution and now my enemies are chasing me too fast ??
Hello everyone! I have developed a game in which there are enemies that run towards you to kill you. The enemy control system is managed by 3 different scripts: one that deals with managing what the...
View ArticleHow to make enemy check if it doesn`t see player for certain times it changes...
Hello guys. So I'm making an finite state machine for my enemy behaviors. I'm detecting if player is in sight of enemy by raycasting using this block of code: public bool TargetInSight() { if...
View Articlehi, i am making a retro game and i have an enemy, and i also have a shoot...
using UnityEngine; using System.Collections; public class shoot : MonoBehaviour { public int ammo; public Animator anim; public float damage = 10f; public float range = 100f; public Camera fpsCam;...
View Article,How to find closest enemy in line of sight, among enemies behind the wall...
Hello! im new here. hope to find some light. im trying to find the closest enemy in line of sight. Is a top down shooter, where there could be enemies behind a wall and in line of sight. i want to face...
View ArticleTrying to create random encounters with percents
I am currently working on a turn-based RPG. I have all my enemies programmed as [SerializedFields] in their own enemy file. This way I can add in enemies and edit their stats easily. I want to add a...
View ArticleNew Animation, Starting at last position of Previous Animation
I have an Animation that plays when an enemy is hit, that switches over from its usual "patrol" animation, so to speak. However, the new animation plays at the base of the enemy's position instead of...
View Articleturret having a range of tiles
what would be the ideal solution to having a turret with a range of tiles. like, if there comes an enemy onto a certain tile that is within the range of the turret, it starts shooting the enemy as long...
View ArticleEnemies in top down shooter being affected by physics of bullet
Hi, I am making a top down shooter mobile game, and I want to know how to make the player's bullets not push the enemies around. The enemy gets pushed back a little bit by each projectile that the...
View ArticleObject: collider to floor, trigger to player
I want to create an enemy in a 2d setting, the player should be able to walk past it, but the enemy should not fall through the floor, the floor has a floor tag and the enemy and player has their own...
View ArticleHow to implement proper enemy follow and shoot
Hi i dont know to how to implent something like a follow and wait and shoot enemy. i add make ammo and its directions but dont know to to implement this type of enemy what i need to add ? please help...
View ArticleHow to start multiple instances of coroutine in another script's coroutine?
Ok this may be a little bit long winded so be patient. I am trying to get a list of all my enemies on my game manager script, then on that same script start a coroutine to loop through each enemy and...
View Article