Checking what type of enemy you hit
Hey so im creating a game where there is going to be alot of enemies and i use raycast for my melee weapon right now im checking the hit collider tag but that will make a big script if i should do it...
View ArticleIm using raycast system for shooting but cant figure out how to add blood...
{void Shoot() { Vector2 mousePosition = new Vector2(Camera.main.ScreenToWorldPoint(Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y); Vector2 firePointPosition = new...
View ArticleHow to make an enemy move along a wall?
I want to make a enemy that move along a wall in my 2d game. First thing i did was check if before it is a wall , if true then rotate 90 degrees up. But what if before it isn't a wall but under it like...
View ArticleUsing a copy of the player as enemy, can't controll the player anymore!
Hi! I'm using a copy of my Player GameObject but when it's active I can't controll my player now. Here is a small part of my code! With the script bellow if the isEnemy bool is set to true, my enemy...
View ArticleSet rotation of enemies coming from spawners
I have several spawners placed around a central point. I'd like the enemies from the spawners to be rotated so that they are facing the central point. Is there a way to set it so that each enemy picks...
View ArticlePlay sound when enemy chase
I try to make whenever enemy is chasing player, a chase theme will play. I've tried the same exact method for sound such as flashlight and it works just fine. But this one didn't work somehow. private...
View ArticleHow to spawn enemies on my spawnpoints
Hey so im trying to make my enemies spawn on a random spawnpoint i have but when i try it it spawn at random positions instead of the spawnpoint this is how they spawn and my spawnpoints public...
View ArticleHow do i make my enemy AI attack?
So i'm really new and i want that my Enemy would attack me and do a certain amount of damage (would be nice if there was a range and delay) Here's my Enemy script: using System.Collections; using...
View ArticleAudio Issue, Plays with PlayOneShot but not Play
So my last question, I kind of fixed but the fix is only working for my Player not the enemies. I need a solution that works across the board. For some reason, the enemy audio isn't playing when using...
View ArticleEnemy dies in editor mode but not in build
Hello. I am using one enemy that has a patrol variation. Normally, the enemy stands still and chases the player when the player comes in radius. I made a version of the enemy that patrols back and...
View ArticlePlayer wont take damage
Hey so for some reason my player wont take damage when he collides with an enemy can someone help me? the error I get is `NullReferenceException: Object reference not set to an instance of an object...
View ArticleWhy it is not showing a message when a player is touching an enemy?
A player has a script within void OnTriggerEnter(Collider player) { print (message: "name"); } A player's Collider Component is triggered. Yet why it is not showing a message when a player is touching...
View Articlehow to make knockback and slowmotion when hit by enemy
is there anyone knows how to make knockback and slow motion when the enemy hits it?Thanks
View ArticleHelp with Generating level
Hello, i am already having generating of level but i need to add generating for enemy for each platform![alt text][1] So i need little help ![alt text][2] [1]: https://i.imgur.com/w27ccG7.png?1 [2]:...
View ArticleMost efficient way to store information in an inspector dropdown menu?
The answer is probably super simple but I've been struggling with this for a while... I am trying to set up a Scriptable Object that holds data for my enemies. So far it's really straightforward: I...
View ArticleEnemy speed calculating
Hello i am making game like helix jump. I have script for enemy movement but i need somehow to encryse speed by cylinder rotation.y. https://imgur.com/a/OSk3HBn
View ArticleHow to I make FindGameObjectWithTag() not just find itself?
I am trying to make a system where a type of enemy only attacks when it is in a group, and runs away when no other enemies are near by. I'm trying to do this by using tags, but the scripts keeps just...
View ArticleEnemy wont take Damage. How could i fix this?,Enemy wont take damage with...
The code i currently have is using UnityEngine; public class Target : MonoBehaviour { public float EHealth = 50f; public void TakeDamage(float amount) { EHealth -= amount; if (EHealth <= 0f) {...
View ArticleHow do I go about making a 2d platform enemy ai
I want a 2D enemy AI that will follow the player and jump onto platforms. After lots of googling, I haven't found much if anything at all. I don't just want an ai the moves towards the player and jumps...
View Articlehow to add firerate to enemies shooting script
i have a script where the enemy will shoot a projectile at the player if the player gets too close, but there is no way to make the enemy shoot faster or slower; it just shoots in slow intervals. how...
View Article