Quantcast
Channel: Questions in topic: "enemy"
Browsing all 1488 articles
Browse latest View live
↧

Changing AI target, after destroying gameObject

Hello. I am working on a game where I have minions fighting. My problem is that when I destroy the first target, I cannot reset a new target for the minion. This is what the console says: >...

View Article


SphereCastAll sees for miles

Hey Guys and Girls, I am using this line of code hits = Physics.SphereCastAll(transform.position,transform.localScale.x / 3,playerTransform.position - transform.position,...

View Article


Need help with enemy spawner

Hi guys, Iv been trying to make a spawner for my enemies but iv hit a wall. At the moment I have a object (with a script) that deals with the spawning of the enemies and I have a script connected to...

View Article

How can I get a GameObject's transform in game and set that to a variable?

I am trying to make a simple game where a cube follows you and you kill it. I want to instantiate the cubes, but my problem is setting the transform that the cube goes for After instantiating the...

View Article

(2d) Enemy not killing player if player stand still?

Just learning and I have followed some tutorials and am just tyring to get basic mechanics of a 2D game going. I use Uscript ( Visual Scripting Tool ) so I will just have to explain what my code is. My...

View Article


Attack/Targeting Script Issue

Hello! I have those two scripts below. What they basically allow me to do is to kind of attack an enemy if the mouse cursor is on the object. The issue here is when i have multiple enemies. For some...

View Article

Instantiate Projectile towards player (regardless of transform.rotation)

I have an enemy in my game who (as you'd expect) shoots at me if I'm in range. I have a gun attached to the enemy model, and a script which instantiates a projectile at the end of it(using a...

View Article

Only one of all my Enemies shoots, Help please.

I am working in a top down view 2D shooter, I am mixing some 3D models and 2D sprites. I managed to get collision from lasers to the enemies no problem, the part I am stuck at is that I want my enemies...

View Article


C# Enemy targetting script problems

I am a beginner to scripting and I am having trouble with my enemy AI script, there are a few things I want to fix on it which are... after my player dies the enemy keeps trying to target the destroyed...

View Article


This Script don't work, Why? / Life players

I have this script: #pragma strict var lives = 3; var livesTexture : Texture2D[]; var livesTextureSize = 30; function OnGUI () { var livesTextureRect = Rect(10,5,livesTextureSize,livesTextureSize); for...

View Article

Health drop, and picking it up.

I have all of the code I need for the health pickup to drop when I kill an enemy, but I have been working for about 3 days with no luck on how to get it to destroy once it's instantiated. Sorry for the...

View Article

Enemy Tag in Range

Just trying to get this script to work... Checks if animation is playing then any enimes near with the tag "enemy" gets HP taken away if (animation["attack"].enabled == true) { GameObject[] enemies =...

View Article

Enemy Health With Raycast Not Working

I have a gun script and an enemy health, but the enemy isnt taking damage when it should be. can anyone tell me whats wrong? ***ENEMY*** var Health : float = 10; function Start() { } function...

View Article


How to add new animations to enemy NPCs through mecanim?

If I were to purchase a character through the asset store that is mecanim ready but does not have any animations in it's files but just the **character only**, and If I were to also purchase animations...

View Article

AI Scripting

Is there a guide on how to script an enemy game Object to follow semi-basic AI commands such as 1. Following paths 2. Shooting at the player 3. Range of sight 4. Deviating from the path to look for a...

View Article


Quaternion.LookRotation Active when not active.

Can anyone help me understand why the Quaternion.LookAT code is being active when it supposed to not be. when the enemy Spawns its Target == null. only when a player with tag player walks into its...

View Article

How do I script enemy movement to follow a specific path?

I'm creating an on-rails 3D space shooter akin to Star Fox. I would like enemies to spawn in certain locations and fly along a certain path, some toward the player and some from behind the player, as...

View Article


bullets kill all enemies, not just the ones hit.

Hi all, I have several enemies walking around my level chasing the player but when I shoot one, all of them take damage. Here is my code attached to my bullet prefab public class Bullet : MonoBehaviour...

View Article

Enemy keeps falling down

This is a problem i have been working on for a while but i do not know how to fix it. when my enemy hits something he falls down (a.k.a falls on his back) the enemy has a rigid body and box colider....

View Article

How to detect enemy in effective way?

Hello, developers. Now, I have trouble with detecting enemy. Most of coders use Raycast when they need something to detect specific thing. But raycasting is not quite good, I think. For example, void...

View Article
Browsing all 1488 articles
Browse latest View live