Quantcast
Browsing all 1488 articles
Browse latest View live

Enemy bounce from screen edges

I want my enemy to bounce off from the edges of the screen like in many video games. I have achieved this however, **there is one problem. the enemy gets stuck on the corners** since it bounces from...

View Article


Make enemy damage the player,Enemy do damage to player Script

So i'm working on my first 2D game and I've made my character to do damage to the enemy , but I can't make the enemy to damage my character. Here's the script for my character combat: using...

View Article


Enemy stops patrolling when player comes close

Hey guys! I am pretty new to Unity and C# so I wanted to ask how it is possible to make my enemy stop moving when the player comes close. My enemy moves this way: if (moveRight) { transform.Translate(2...

View Article

Enemy is not chasing player. it is escaping.

Hello I writed some scripts but enemy is moving away from my character here is the scripts I need this help so much I'm beginner I can' solve this. ![alt text][1] ![alt text][2] [1]:...

View Article

How can I activate and deactivate an enemy on player proximity

Hi all, I am making an open world game and the last few days I am struggling with multiple enemies on scene that make fps drop to low,I have tried occlusion and LOD systems but when player turn his...

View Article


Enemy object does not enter collide and trigger functions

**Hello, I just started learning C# and unity. I'm practicing what I've learned. What kind of mistake could I have made in this script? My enemy object is moving towards to player but dont attack when...

View Article

Victory music when enemy dies, help

Hi! I am having issues creating a victory music for my game. I am making a 2d platformer where the main character tries to save her grandma from an evil plant. What I want to happen is that when the...

View Article

Can someone Tell me how I can make the enemy shoot the player when the see...

Hi, I'm currently making a small shoot em' up game and I've hit a roadblock when trying to find a way for the enemy's to shoot the player when they see them. I've tried everything (I think) and I've...

View Article


Health below zero but shows negative numbers

Hi guys! In my game I have 100 health and different enemies who deal different amounts of damage. The problem is that sometimes my health goes negative which I don't want to have. Probably the problem...

View Article


Game Combat

Hello, I'm currently a first year student at college studying Computer Science. I have a project/game that I almost managed to complete, but I'm struggling to figure out how to implement combat. I...

View Article

Wave Spawner not working |Does not detect if an object is destroyed

Hey, I have a question regarding this script. I have watched this tutorial several times but I can't detect the error. Can someone help me? The script is spawning 2 Enemies like i said it should do,...

View Article

Bullet not shooting enemy center in unity

Hello, can you please help me to create correctly shoot of bullet to enemy center with my method ? private void Update() { if (GameObject.FindGameObjectWithTag("Enemy") && !_shooting) {...

View Article

NavMesh and WaveSpawner dont work together!

Hello! I have a question about my NavMeshAgent and my WaveSpawnerScript. My NavMeshAgent has an empty GameObject named ''target'' as destination. This target is linked to my character. This all works...

View Article


Stop Spawning all enemies at once and destroy after time

Hey guys! I have a WaveSpawner but in my case in one wave all enemies are spawned at the same time but actually I want them to spawn one by one so with kind of a delay. Maybe I could use...

View Article

Need help destroying my enemy when he is killed

I have a working enemy that moves to the player and can be killed but when he is killed he still follows me around so I came up with the idea to have him be destroyed but after looking around the...

View Article


When the enemy character shoots, the bullet won't go to the position of my...

When the enemy character shoots, the bullet won't go to the position of my player. **The Enemy Script:** using System.Collections; using System.Collections.Generic; using UnityEngine; public class...

View Article

How do i make the enemys sprite rotate when it reaches the other side ?

So i v been working on a metroidvenia for a long time and resently i remade the enemys. The way that the enemy work is that i set a movement distance and movement speed and than it just move form left...

View Article


Making an enemy go back to its spawn after losing target

**Hey everyone, this is my enemy script - it has everything (the enemy runs after the player when he is inside a circle collider attached to him). But this is not the problem - I'm trying to make it so...

View Article

Enemy's initial attack doesn't deal damage to player

Good evening, I'm having an issue where any enemy my player first encounters attacks, the first attack doesn't deal damage. However, subsequent attacks after that register the damage. I'm not quite...

View Article

How to get the position of a new Instantiated prefab

Hi to everybody!! I have two same enemies already instantiated in the scene from a unique prefab "Dogor (clone)" and I'm instantiating also one bullet to make both to shoot the same bullet, I'm...

View Article
Browsing all 1488 articles
Browse latest View live