If an enemy is destroyed, how do I make it stop appearing even if I restart...
In my game there are enemies that do not reappear once you kill them. I want to know how I do that. (I don't speak English so excuse me if my English is weird)
View ArticleFPS Microgame Boss Objective
Hello! I've been playing around in the FPS Microgame and added a boss. I would like the game to end once you beat the boss. You get an Objective script that ends the game after you kill x amount of...
View ArticleRaycast Shoot Error
My game is a simple FPS. What I'm trying to do is have it so that each time a raycast shot by the player hits an enemy, their health decreases by a defined amount. but when i shoot the enemy once, it...
View Articlethe attack is synchronized if there is more than one enemy
so basically when my Hero in rage of enemy attack the animation is start to paly and enemy is attacking that all cool and it's working, but if i make the clone of enemy and place the enemy clone else...
View ArticlePrefabs executing in a wrong way.
Well, I'd like to start this question notifying you that I am Brazilian, so my English is in progress. I've made a prefab and put some of them on the Scene while run a script. The script is responsible...
View ArticleTrying to add a tracker to enemy AI either prefab or with reference
I am trying to make a tracker for the enemies AI to follow the player, but I cannot put a tracker because it is in a different scene, is there a way I can reference it?![alt text][1] [1]:...
View Article2D Raycast is not working (No Errors)
Hello, i am trying to make a enemy that is going to attack me when I enter his triggerArea but for somehow the raycast doesnt activate. I dont have any error either. I watched a youtube video and I...
View ArticleMy enemies wont move!
I'm working on a 2d platformer, and originally I had enemies move between two box colliders, turning whenever it triggers one. This worked... until it didn't, so I looked up a tutorial for enemy...
View ArticleEnemy attacking enemy when defeated
hi, I'm trying to make a 2d top down game where if I defeat an enemy, then the enemy fights for me. I'm trying to destroy the original enemy object when health = 0 and will set is Dead bool to true,...
View ArticleHow would I implement this reload system?
I'm making a game where reloading is a core game mechanic. I am nowhere near implementing it yet but I am fairly sure I can get the reload done with a timeline, which I start whenever I want to reload....
View ArticleNo Gravity?
i made this enemy script but my enemy starts flyng when i jump and it goes through walls (it has a Rigidbody and a boxcollider) using System.Collections; using System.Collections.Generic; using...
View Articledamage player on start NOT collision,how do i damage the player on enemy...
so i have this basic enemy script that works fine public class Enemy : MonoBehaviour { public float health; public float damage; public GameObject deatheffect; public void Update() { if (health <=...
View Articlehow can i make my enemy attack player and move idle
using UnityEngine.AI; public class EnemyMovement : MonoBehaviour { public float fov = 120f; public Transform target; public bool inSight; public float AwakeDistance = 200f; public bool AwareOFPlayer;...
View ArticleHow do I get the name of the object I am attacking and how can I use it to...
public void attackdamage() { snpc.GetComponent().ehealth -= 20; } - private void OnTriggerEnter(Collider other) { pplayer = other.gameObject.name; }...
View ArticleHow can I have the player be able to kill an enemy by jumping on top of it?
I am making a 2d style platformer but in 3d and I want the player to kill an enemy by jumping on top of it. Right now the enemy is just simple box. I figured out 3 solutions that kind of work. The...
View ArticleHow can I check if my Player leaves a Sphere?
Hello there. I am currently working on my first unity-project (3D). So far i have a working CharacterController and an Enemie which is Patroling if the Player is outside of a given sphere around the...
View ArticleEnemy AI script working with States Unity 2020.3
I made an enemy, created its script and made it all work properly. Thing is, I heard that States can be used to make this type of thing more optimized, but i cant seem to figure out how to use them....
View ArticleCan someone help me to understand why this raycast is not working properly?
![alt text][1] [1]: /storage/temp/182650-screenshot-2021-06-26-194508.png RaycastHit hit; var rayDirection = Player.transform.position - Enemy.transform.position; Debug.DrawRay(transform.position,...
View ArticleEnemy attacks player but only once
So I have an enemy that chases the player and attacks it once it interacts with the player's collider, but the enemy only attacks it a single time. I want it to attack the player multiple times until...
View ArticleHow could i access to a specific collider box if it is in a children of the...
Im making a 2D game so i want my enemy to receive damage when my player hits, the issue that i have is that i dont know how to call just the collider box that is in a children of the main objet(in this...
View Article