Get position of prefab enemy ?
Hello, I have a prefab of enemies who spawn regularly. I try to get the position of them in order to kill them. It work with the one already instanciate but not the new. First I get the gameobject and...
View ArticleSince my enemies are in a prefab they don't lose health
Hello guys ! I am making a game, and I have a player you can translate on enemies to kill them but since the foes are instantiate with a prefab and a spawnpoint I can't hit them. Maybe because the...
View ArticleMy enemy don't take damage.
Hello to you ! I have a problem, my enemies refuse to die....(they are spawn and not already instanciate). I think it's because i can't get his current life from his script. But I tried everything and...
View ArticleCan't manage to damage enemies...
I am sorry for so much redundancy, but I can't kill my enemy and there is no reason I can see. GameObject GestureAttack() { invincible = true; GameObject[] Foes =...
View ArticleI kill all myenemies instead of one
Hello ! I managed to damage my enemies after a lot of difficulties but, now, when I kill one the other dies too. GameObject GestureAttack() { invincible = true; GameObject[] Foes =...
View ArticleSeparate different kind of prefab/enemy ?
Hello ! I am making a game where I have different prefabs, each represent a different kind of enemy. They all have the same script to control theme, however I want a way to differenciate them. So I am...
View Articleteleportation problems (2d)
i want to make an enemy that when touched teleports the player to x0 y4 zn/a here is what I have: using UnityEngine; using System.Collections; public class kill_player : MonoBehaviour { public...
View ArticleMy enemy is destroyed instantly! unity 5.2 C# 2d
Hi, I have a player who has a gun and shoots. i also have and enemy. the problem is is that when my enemy spawns he instantly is destroyed. I only want him to be destroyed on collision with...
View ArticleEnemy walking through walls/terrain
Hi, I have a script for my two enemies in my game, and both of them will walk through walls and terrain regardless. The Script is below: using UnityEngine; using System.Collections; public class...
View ArticleHow do I synchronize attacks and damage to enemys?
I got a PUN Network server for my game, my position and rotation got Instantiated from the Script but not the Attacks and Damage to the Enemys. How do I instantiate these ? Here is my PhotonNetwork...
View ArticleTurning player toward enemy after bool is true/button is pressed
So, I need my player to still be movable but turn towards an enemy while holding down a button - kinda like a lock-on. But this all has to be in a 2D environment (It's a top down brawler). Here's the...
View ArticleObject Pooling - Infinite Enemies on z axis
Hi, I'm trying to make a 3D infinite runner. For spawn enemies i'm trying to use the object pooling I would like to disable the enemies when the player position is greater on the z axis, finally...
View ArticleHow the bullet does not pass through the object? c#
When the player is to shoot the enemy. If the bullets hit the object. Bullet does not pass through the object. ![alt text][1] Thanks [1]: /storage/temp/70797-photo-2016-05-26-17-28-32.jpg
View ArticleTwo Cloned Objects with the same Animator, only one object's transitions work
I followed this tutorial of making enemy ai: But when I try to clone the object, the clone does not switch animation state. But when I delete the original and leave only the clone, it works. Why is it...
View ArticleEnemy Movement With Physics (2D)
I'm trying to create enemy units that float around on a 2D plane. The script I have below makes the enemy object move, but instead of floating around, it is jumping from one spot to another....
View ArticleLinking projectiles to enemy
Hi, I want to be able to link the script of my projectiles to the enemy hands, so that they can damage them, but after you destroy one hand, you get a null reference exception, so i'm wondering how you...
View ArticleMake enemies spawn faster with timer? (C#)
I have a timer in my 2D survival game that always counts upwards, now I spawn out a new enemy between 4 and 6 seconds with the help of IEnumerator. But I have a little problem, since I want the game to...
View ArticlePush back an enemy on trigger
I have two gameobjects, one of them is my "hero" an the other one the enemy with a NavMesh, I've managed to make the health system without problems but know when the sword collides with the enemy it...
View ArticleWhy is this AddForce Error coming up?
I am trying to complete my enemy animation for the opposite AI to move towards my player but Monodevel keeps popping up with this error message. ---- using UnityEngine; using System.Collections; public...
View ArticleCan OnTriggerEnter2D trigger again once triggered?
So I have this code: void OnTriggerEnter2D (Collider2D other) { if (other.tag == "Arena") { wallTrigger = false; } if (other.tag == "GamerWeapon") { var magnitude = 16000; var force =...
View Article