Quantcast
Browsing all 1488 articles
Browse latest View live

Enemy shouldn't walk with the player

I am a little bit new at unity, and now I was trying to make enemies. I started like the way how I started with making a player until I wanted to set **the walking animation.** The walking animation...

View Article


Collision Detection Issue with SetActive(false) not working

When I throw something at an enemy, it doesn't detect collision. I have a Rigidbody and Capsule collider on the player (Correctly placed on the player). For Enemy I have the same, a Rigidbody and...

View Article


Bullet doesn`t die when enemy destory

Good evening! I have a problem. When enemy get to the castle and get killed - bullet stop to fly and doesn`t die ![alt text][1] [1]: https://i.ibb.co/F7WsJCY/Untitled-1.jpg

View Article

Lock onto a target

My current code is below. I am wondering if there is a way for me to lock onto a target? I have tried transform.lookat(target) when button is pressed but the character doesn't stay looking at the...

View Article

How do I go about adding basic pathfinding to my enemy?

I have a top down 2D game, and I need the enemy to go from its current position to a different one (I know the location of where it needs to go). Currently, I rotate the enemy to face the new position,...

View Article


My targeting system isn't targeting the character

I have a player targeting system where enemies fire at the player. But instead of firing at the player the missiles target the player manager and follows it to whatever side of the passage it's on. I...

View Article

How to make enemies take wider routes?

I'm currently using A* pathfinding to mainly control my enemy's movement, however, I'm having a problem with it being constantly in contact with the collider, and it struggling to get around the...

View Article

2d platformer: Why can't Ellen deal damage to enemy by squishing it?

Hi, I'm new to Unity so my question might be elementary. In the 2d platformer kit we are taught that any object with a **damager** component can deal damage to an object with **damageable** component....

View Article


When more than 1 enemy they cant die

So I'm trying to make an enemy but when there are 2 enemies when the first one dies the second one just go in minus in health and I just can't seem to fix it can anyone help me? using...

View Article


How to make enemy detect a character in his certain range?

Hello i created a CSharp code that should cover my enemy AI (enemy detects player in his range, follows him and if my character gets out of enemy detection range he stops following my character). Every...

View Article

EnemyAI code help

Hello, I am trying to make this code work. But iam still getting same error "Cannot implicity convert type '[Enemy]' to 'System.Collection.Generic.List' Here is the code using System.Collections; using...

View Article

I have 2 enemies connected to one script but when one enemy dies using...

when the player kills one of the enemies it no longer attacks the other enemy but the other enemy still attacks the player

View Article

Enemy Flash on hit in 3D game

I can't seem to find working code that has enemies flash when taking damage in 3d. I just want it to flash red for a second and then go back to its original material, but none of the code I've found...

View Article


Play sound only once.

Hi! i have a enemy and i want to play his sound, i play his sound when the player is near him, but if the player not move, all time it called, like a Update(), how could I call the sound correctly?...

View Article

[PUN] Getting warnings and having problems with instantiation and PhotonView

So I am suddenly having a problem with the instantiation of my objects. This started happening after I changed something and even when I revert my changes the warnings still happen so I'm not sure if...

View Article


Why enemies are inactive?

I have a shooting game, in which four enemies appear by sequence one after another. What happens is that only the first enemy appear, and others don't appear until i check one of them as active during...

View Article

how to do to in second tap on screen of smartphone to create object and to...

this is my joystick public class myJoystick : MonoBehaviour { public Transform player; public float speed = 5.0f; private bool touchStart = false; private Vector2 pointA; private Vector2 pointB; public...

View Article


How can I Make 2D enemies follow a player until the player is on a different...

Sorry Im new to unity in advance. Im going for a single 2D platform that when I jump on it enemies will stop following the player and the enemies will move towards a game object(such as a jumpad) and...

View Article

How to move an object across terrain?

I have these enemies that follow the player when it comes within the enemies range, but when I jump or walk down a hilly terrain the enemy stays floating in the air while still following the player. So...

View Article

Text wont show the distance to the nearest enemy

hey idk why but my script wont tell me the distance to the nearest enemy this is my script can anyone help me? public void TargetFinder() { foreach (var x in enemies) { float distance =...

View Article
Browsing all 1488 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>