Not kidding, this was the video I needed! I could NOT figure out how to get my bad guy to flip by the y axis, and after applying your solution, IT FREAKING WORKED! I was running around screaming at 1:20 am! You are a gift from God!
I was looking for a way to make the enemy chase me all the day on youtube and you're are the only one who actually did what I wanted to do, so thank you for real
Omg, tnx you really helped me alot, also you are so funny in videos I subbed and liked the video. Im new to unity so your tutorials are helping me ALOT. Love you and your vids and i wanna see more. Bye!! ;D
For issues with enemy vibrating back and forth, while player is above, I added this to ChasePlayer: if (transform.position.x - player.position.x = 0f) { StopChasingPlayer(); }
John, please do a full fledged enemy controller, with melee, ranged, flying options.... including the animations. You must have done it for your game. You're so easy to follow, I want to learn from you. Thanks.
Hey, man. Your tutorials are so underrated. I learned a lot from this and I was able to incorporate a few things on my own using your code as a base. Thank you for sharing your knowledge!
Great tutorial! I found a hilarious bug that happens if you jump on top of the enemy and the enemy's speed is really high, the sprite started flickering left to right and slowly phased through the ground
WhiteNoise Hey, so I managed to fix it. What I did was create a variable to denote a minimum aggro range, and a boolean to let the enemy know that if the player is less than a certain distance away, it should not attempt to follow.
probably happens because its at your position (at least to humans) but the enemy wants to be pixel perfect and tries to get to the exact x position but always overshoot by a few pixels and keeps going back and fourth. Just a guess
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Enemy : MonoBehaviour { [SerializeField] public Transform player; private Rigidbody2D rb; private Vector2 movement; [SerializeField] public float moveSpeed = 5f; [SerializeField] float agroRange;
These guides have been so helpful. Usually I start searching on RUclips and for something that I want to do in my game and I come across someone like Brackeys. Now, Brackeys is good and all and I have learned from them as well, but sometimes I think they're just a bit too extra. Then I do a bit more digging and come across your video and it's exactly what I need. Or you present a different way of doing something that helps me think through the problem that I'm having. Great stuff, man. Definitely just going to start consulting your channel first before I do a general RUclips search.
I'm really happy to hear that! I think carefully about how I can best communicate the information before making these tutorials, so I'm glad the outcome is appreciated, all the best to you!
@@LostRelicGames To you as well, man! I've been watching your Blood and Mead videos recently and have been eagerly awaiting to play it myself sometime. Just great content all around!
Thanks for this video. How can I make it so that the enemy stops when in attacking range as well as when it is not in aggro range. Because right now he is still running towards the player and when I leave the aggro range it will then do the animation for attacking
Great video! But whenever I get directly above or below the enemy, it starts flipping back and forth really fast because it can’t decide which direction to go. Any ideas?
This is old but just in case anyone else comes to the comments to find the answer for this, here was my solution: if (transform.position.x + -.3f > target.position.x) { enemy.enemyMovement.MoveLeft(); } else if (transform.position.x + .3f < target.position.x) { enemy.enemyMovement.MoveRight(); } else { enemy.enemyMovement.Idle(); return; } As soon as the enemy was within the .3f distance left and right it would instead call the idle function I'd made in my movement script. Makes the enemy follow underneath you without spinning.
If you have your scale higher than 1 on your enemy, and then it calls the transform.localScale = new Vector2(1, 1); my enemy just turns small. I think that's the problem but I dont know how to fix it. Could I change the size of my enemy without doing it in the transform? Also it looks the opposite way of where the player is once it finds it. (still chases it though, just backwards and small).
here is a script for up-down games you might have t change it a little for you're game Mabey using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Enemy : MonoBehaviour { [SerializeField] public Transform player; private Rigidbody2D rb; private Vector2 movement; [SerializeField] public float moveSpeed = 5f; [SerializeField] float agroRange;
This is so good explained!! Thank you!! You're videos ar always so helpful!! do you know a good way to make a player aim in a 2d side plattformer game? If yes, is there a difference between pixel character animated frame by frame and a character bone rigged? Or what must be done to make a character aim with a gun, pistol or bow?
Hi Josef 2d platformer aiming can be done in a few ways. One way would be to make the arm that holds the pistol a separate component that rotates based on input. I may make a video about it for you. Also n swing by the discord if you want to talk in more detail! :)
Can you help? I set it that my enemy would attack the player, but when the transform is destroyed it crashes. When I use prefabs it doesnt do anything.. the enemy does not even move...
Hey. The prefab will need a fresh player reference when it is instantiated. And for the other issue; when you destroy a game object the script also gets destroyed with it. Adding some check to see if the object is still alive can solve this. Hopefully this information helps!
@@LostRelicGames Hey. I'm relatively new to this only doing it for my end of term project. I don't understand the first sentence im sorry. I added an if statement f player != null etc in the update() and it works but still, the transform is missing. Is there a way to automatically assign the transform? sorry if it's a dumb question. Thanks anyway
the problem is in the localscale, depending on the size that you set for the sprite of the enemy, it most likely changes size because the default avatar size is set to a certain thing and the avatar you are using to another, when on the local scale make sure that you set the numbers to the size of the avatar you are using, let´s say you set you enemy to be x 5 y 5, then check it is the local scale to have the same size
Nice tutorial man keep it up i have a question like do you use those methods for your game to? Like all those tutorials you keep posting? And do you use a State Machine for some things or not? Again much love for those tutorial hope you will get a bigger platform on YT. Ps Do you also help people with their needs if they are stuck on something?
Hey! I use many of the techniques in my own game 100%, though as my game has grown, I have often changed approaches. My own game has vastly more robust structue; Data models, controllers and data processed from json files. I plan to slowly move into these more advanced topics in the tutorials. Regarding state machines, I have my own custom state machines which manage both game flow and also character animation states! :) thanks for the comment!
Oh and come by the discord! I personally help people there. We are about 150 game developers there helping each other. The link is in the channel banner
Hi, this would suggest your original scale was less than 1. It's typically good to work in a 1:1 scale, but as a work around you can store your base starting scale in a Vector2 variable at the top of your class, (Vector2 baseScale = transform.localScale), and use that instead of (-1, 1), which would then look like (-baseScale.x, baseScale.y).
Great video and teacher I'm having this issue the enemy's follow me but when I jump on them they just fall through the floor , and when i jump off a platform they just keep following me floating. Just starting to get back into game dev. :)
Great tutorial! So my plan was to set my enemy active when its in the distance and disable it when its not. I did the if statments and inside I put gameObject.SetActive(true); if disttoplayer
Ok this is what I did, I made the script go on an empty object and made a public variable for my enemy, then I said enemy.gameObject.SetActive(true & false dedpending on if its in the if or else) But I have multiple enemies in my script and want all of them to be affected and I don't want to add the script 100 times to my empty,.
hello again my friend, The enemy character is following, but while falling vertically, it goes down slowly while on top of the player. I want it to fall on me, what are we going to do? thank you. ***If I couldn't explain it fully, I can send the screenshot as an e-mail.
hello anyone have some problem like mine did? my enemy keep spinning like crazy when i jump over it to the left but it's normal when i jump over it to the right. i've followed the tutorial precisely thou. really strange
i don´t know what i did but my enemy doesn´t appear in the display, he is invisible, i don´t know if i messed with the ordering layers or what happened
I had that happen as well after I already had it working. When I exited the project after saving and loaded it back up a couple hours later, something wasn't working right. Got really frustrated, couldn't the problem/solution. Loaded it back up again today, first thing I notice was that the position for the Object that was invisible in the display was for some reason set to Z: -315.82728....Don't know how or why that happened, but as soon as I changed that to a Z value less than the Z value of my Main Camera, it was fine. So that might be what happened. THe stupid thing is, I checked the positions and layers like 30 times the previous day, but ah well.
@@jaypost6202 Hey thanks, i actually managed to fix it a while ago and i had the same problem, i still don't know what happened but eh, unity gets weird sometimes i suppose, but thank you, really!
This Is My Other Acount For Real I Was Just Trippin What Happened Was I Downloaded A Asset Pack And it fuked up my layers So All I Had To Do Was Change The Layer To Ground Also Great Video My G, [:
I get error on this code distanceToPlayer = Vector2.Distance(transform.position - player.position); //Vector2 is an ambiguous reference between 'System.Numerics.Vector2' and 'UnityEngine.Vector2'. How to fix this?
Ok so the way I "simply" fixed this is, refrence the rb in your public class, then in start, player = GameObject.Find("Player").GetComponent(); please let me know if there is a better way of doing this.
Ok so I have a new issue, my enemy is patrolling, yet as it moves back and forth the distance print changes briefly and then stops, not showing the constant dis between the two.
The moment when I'm following along with this tutorial and my enemy stop chasing my player when I get outside of the agro range even though I haven't written any code for StopChasingPlayer() XD
I know this comment is a bit late but if anyone can help plz do it..so the problem is my enemy squeezes when the player enters the range.other than tht everything works fine
A very useful video it helped me make my aggro script for the enemy to chase my player attaching the script of the look at player part please let me know what you think //turn towards player and face player till out of range if (Vector3.Distance(_transform.position, transform.position) < 20f) { transform.localScale = new Vector2(-1, 1); } if (transform.position.x < _transform.position.x) { transform.localScale = new Vector2(1, 1); }
for a cleaner script. "don't" serialize the variables, and instead start each with "public" (including the rigidbody2d) and instead of the GetComponent with the rigidbody2d (in the start function), just add the same way you did with the player transform. hope this helps.
I respectfully disagree with everything you have just proposed. Making things unessessary public pollutes the scope. There is also no issue with retreiving components in the start up functions. It's how they were designed to be used.
Part 2 here, Enemy line of sight detection with Raycast!
ruclips.net/video/2VX8uD_xUlM/видео.html
great tutorials dude! you've been a huge help to me! thanks for making these vids!!
In the immortal words of Mr. Burns... "....Excellent."
Not kidding, this was the video I needed! I could NOT figure out how to get my bad guy to flip by the y axis, and after applying your solution, IT FREAKING WORKED! I was running around screaming at 1:20 am!
You are a gift from God!
Hahaha! seeing your comment is a big driving force for me to make these tutorials! Thanks for sharing your excitement :)
John wick , like Game Developer is the best.
I was looking for a way to make the enemy chase me all the day on youtube and you're are the only one who actually did what I wanted to do, so thank you for real
Hell yeah! Happy to hear this!
I love the characters, they're super cute. You could actually make a game with characters like that intentionally
This tutorial worked flawlessly for me. i have 3 different enemy AI types now
You are amazing
Just keep making videos and it will take time to make enough subscribers
But never think of stopping this channel
Ayy bro, you are the first person to actually explain every line of coding, best developer! 😀
He definitely isnt, but yeah hes a great dev
@@knt5429 true
this is best tutorial i have ever seen, thanks a lot. 👌
Omg, tnx you really helped me alot, also you are so funny in videos I subbed and liked the video. Im new to unity so your tutorials are helping me ALOT. Love you and your vids and i wanna see more. Bye!! ;D
Awesome tutorial thank you so much for this. Please make a tutorial on enemy AI attack or shooting.
For issues with enemy vibrating back and forth, while player is above, I added this to ChasePlayer:
if (transform.position.x - player.position.x = 0f)
{
StopChasingPlayer();
}
Thank you so much for this awesome tutorial! This helps immensely!
John, please do a full fledged enemy controller, with melee, ranged, flying options.... including the animations. You must have done it for your game.
You're so easy to follow, I want to learn from you.
Thanks.
Hey, man. Your tutorials are so underrated. I learned a lot from this and I was able to incorporate a few things on my own using your code as a base. Thank you for sharing your knowledge!
Hey Abraham, my pleasure. I'm thrilled to hear it was able to help you!
@@LostRelicGames I subscribed to your channel. 💪💪💪 Looking forward to your new videos
Thanks keanu love your tutorials
Great tutorial! I found a hilarious bug that happens if you jump on top of the enemy and the enemy's speed is really high, the sprite started flickering left to right and slowly phased through the ground
yea it happen to me too, how to fix that ?
I just implemented this and it works like a charm. As always, thank you for sharing your knowledge!
I'd really like a version of this for 3d rigidbodies. Great video though!
I'm getting this really weird effect where my enemy sprite keeps flipping back and forth wildly when I'm directly on top of him :c
same problem here
WhiteNoise Hey, so I managed to fix it. What I did was create a variable to denote a minimum aggro range, and a boolean to let the enemy know that if the player is less than a certain distance away, it should not attempt to follow.
@@In.Gy. nice
I'll try that
Thanks:)
probably happens because its at your position (at least to humans) but the enemy wants to be pixel perfect and tries to get to the exact x position but always overshoot by a few pixels and keeps going back and fourth. Just a guess
Awesome work, keep it up.
Great tutorial
Hello, great tutorial, i learned a lot. i'm sure it's a simple few lines but how would you make the enemy follow along the y axis also?
Great video, Do you have a video making a basic finite state machine for enemy AI. Thank you.
Thanks, nice tutorial.
10:00 .... what will be the Y if enemy also have vertical movement..
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField]
public Transform player;
private Rigidbody2D rb;
private Vector2 movement;
[SerializeField]
public float moveSpeed = 5f;
[SerializeField]
float agroRange;
void Start()
{
rb = this.GetComponent();
}
void Update()
{
float distToPlayer = Vector2.Distance(transform.position, player.position);
Vector3 direction = player.position - transform.position;
direction.Normalize();
movement = direction;
if(distToPlayer < agroRange)
{
moveCharacter(movement);
}
else
{
StopChasingPlayer();
}
}
private void StopChasingPlayer()
{
rb.velocity = new Vector2(0, 0);
}
void moveCharacter(Vector2 direction)
{
rb.MovePosition((Vector2)transform.position + (direction * moveSpeed * Time.deltaTime));
}
}
Best tutorial please make more I love it
These guides have been so helpful. Usually I start searching on RUclips and for something that I want to do in my game and I come across someone like Brackeys. Now, Brackeys is good and all and I have learned from them as well, but sometimes I think they're just a bit too extra. Then I do a bit more digging and come across your video and it's exactly what I need. Or you present a different way of doing something that helps me think through the problem that I'm having. Great stuff, man. Definitely just going to start consulting your channel first before I do a general RUclips search.
I'm really happy to hear that! I think carefully about how I can best communicate the information before making these tutorials, so I'm glad the outcome is appreciated, all the best to you!
@@LostRelicGames To you as well, man! I've been watching your Blood and Mead videos recently and have been eagerly awaiting to play it myself sometime. Just great content all around!
Most underrated unity tutorial channel. Its more simple than triggerenter,stay and exit.
Thanks for this video. How can I make it so that the enemy stops when in attacking range as well as when it is not in aggro range. Because right now he is still running towards the player and when I leave the aggro range it will then do the animation for attacking
mate can u pls give me the code?
dude you're a lifesaver
Great tutorial! I am waiting your next tutorials as well.
Great video! But whenever I get directly above or below the enemy, it starts flipping back and forth really fast because it can’t decide which direction to go. Any ideas?
This is old but just in case anyone else comes to the comments to find the answer for this, here was my solution:
if (transform.position.x + -.3f > target.position.x)
{
enemy.enemyMovement.MoveLeft();
}
else if (transform.position.x + .3f < target.position.x)
{
enemy.enemyMovement.MoveRight();
}
else
{
enemy.enemyMovement.Idle();
return;
}
As soon as the enemy was within the .3f distance left and right it would instead call the idle function I'd made in my movement script. Makes the enemy follow underneath you without spinning.
If you have your scale higher than 1 on your enemy, and then it calls the transform.localScale = new Vector2(1, 1); my enemy just turns small. I think that's the problem but I dont know how to fix it. Could I change the size of my enemy without doing it in the transform? Also it looks the opposite way of where the player is once it finds it. (still chases it though, just backwards and small).
Try instead transform.eulerAngles = new Vector2(0,0) in movespeed
in -movespeed transform.eulerAngles = new Vector2(0,180)
here is a script for up-down games you might have t change it a little for you're game Mabey using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField]
public Transform player;
private Rigidbody2D rb;
private Vector2 movement;
[SerializeField]
public float moveSpeed = 5f;
[SerializeField]
float agroRange;
void Start()
{
rb = this.GetComponent();
}
void Update()
{
float distToPlayer = Vector2.Distance(transform.position, player.position);
Vector3 direction = player.position - transform.position;
direction.Normalize();
movement = direction;
if(distToPlayer < agroRange)
{
moveCharacter(movement);
}
else
{
StopChasingPlayer();
}
}
private void StopChasingPlayer()
{
rb.velocity = new Vector2(0, 0);
}
void moveCharacter(Vector2 direction)
{
rb.MovePosition((Vector2)transform.position + (direction * moveSpeed * Time.deltaTime));
}
}
This is so good explained!! Thank you!! You're videos ar always so helpful!!
do you know a good way to make a player aim in a 2d side plattformer game? If yes, is there a difference between pixel character animated frame by frame and a character bone rigged? Or what must be done to make a character aim with a gun, pistol or bow?
Hi Josef 2d platformer aiming can be done in a few ways. One way would be to make the arm that holds the pistol a separate component that rotates based on input. I may make a video about it for you. Also n swing by the discord if you want to talk in more detail! :)
It would be great if you teach how you created those two characters and you animated them. Thanks
Can you help?
I set it that my enemy would attack the player, but when the transform is destroyed it crashes. When I use prefabs it doesnt do anything.. the enemy does not even move...
Hey. The prefab will need a fresh player reference when it is instantiated. And for the other issue; when you destroy a game object the script also gets destroyed with it. Adding some check to see if the object is still alive can solve this. Hopefully this information helps!
@@LostRelicGames Hey. I'm relatively new to this only doing it for my end of term project. I don't understand the first sentence im sorry.
I added an if statement f player != null etc in the update() and it works but still, the transform is missing. Is there a way to automatically assign the transform? sorry if it's a dumb question. Thanks anyway
this was a great video it helped me
Is there any way to increase the gravity?? My enemy just keeps floating until it hits the ground when it walks off the stairs
under the rigidbody settings, try increasing the gravity scale
@@LostRelicGames doesn't work my enemy just floats through the floor both have box colliders and are not set to on trigger can you help?
@@LostRelicGames it still floats
15:26 when my sprite flips it changes size becoming huge, how do I fix this?
the problem is in the localscale, depending on the size that you set for the sprite of the enemy, it most likely changes size because the default avatar size is set to a certain thing and the avatar you are using to another, when on the local scale make sure that you set the numbers to the size of the avatar you are using, let´s say you set you enemy to be x 5 y 5, then check it is the local scale to have the same size
Hemos this doesnt seem to work on prefabs
good man cool video thank you
Nice tutorial man keep it up i have a question like do you use those methods for your game to? Like all those tutorials you keep posting? And do you use a State Machine for some things or not? Again much love for those tutorial hope you will get a bigger platform on YT.
Ps
Do you also help people with their needs if they are stuck on something?
Hey! I use many of the techniques in my own game 100%, though as my game has grown, I have often changed approaches. My own game has vastly more robust structue; Data models, controllers and data processed from json files. I plan to slowly move into these more advanced topics in the tutorials.
Regarding state machines, I have my own custom state machines which manage both game flow and also character animation states! :) thanks for the comment!
Oh and come by the discord! I personally help people there. We are about 150 game developers there helping each other. The link is in the channel banner
thank you for this tutuorial
I have a problem, when I entered "transform.localScale = new Vector2 (-1, 1);" when the enemy rotates his scale becomes huge
Hi, this would suggest your original scale was less than 1. It's typically good to work in a 1:1 scale, but as a work around you can store your base starting scale in a Vector2 variable at the top of your class, (Vector2 baseScale = transform.localScale), and use that instead of (-1, 1), which would then look like (-baseScale.x, baseScale.y).
@@LostRelicGames thank you very much! :)
@@LostRelicGames Ah another question, I did not understand what AGRO means?
Great video and teacher I'm having this issue the enemy's follow me but when I jump on them they just fall through the floor , and when i jump off a platform they just keep following me floating. Just starting to get back into game dev. :)
how can i make it go on the y axis as well
Great tutorial! So my plan was to set my enemy active when its in the distance and disable it when its not. I did the if statments and inside I put gameObject.SetActive(true); if disttoplayer
Ok this is what I did, I made the script go on an empty object and made a public variable for my enemy, then I said enemy.gameObject.SetActive(true & false dedpending on if its in the if or else) But I have multiple enemies in my script and want all of them to be affected and I don't want to add the script 100 times to my empty,.
Thanks for the video..
hello again my friend,
The enemy character is following, but while falling vertically, it goes down slowly while on top of the player.
I want it to fall on me, what are we going to do?
thank you.
***If I couldn't explain it fully, I can send the screenshot as an e-mail.
Wouldn't the enemy stop chasing player if the player run away? Because the distance is already bigger than the agroRange value?
hello anyone have some problem like mine did? my enemy keep spinning like crazy when i jump over it to the left but it's normal when i jump over it to the right. i've followed the tutorial precisely thou. really strange
i don´t know what i did but my enemy doesn´t appear in the display, he is invisible, i don´t know if i messed with the ordering layers or what happened
I had that happen as well after I already had it working. When I exited the project after saving and loaded it back up a couple hours later, something wasn't working right. Got really frustrated, couldn't the problem/solution. Loaded it back up again today, first thing I notice was that the position for the Object that was invisible in the display was for some reason set to Z: -315.82728....Don't know how or why that happened, but as soon as I changed that to a Z value less than the Z value of my Main Camera, it was fine. So that might be what happened. THe stupid thing is, I checked the positions and layers like 30 times the previous day, but ah well.
@@jaypost6202 Hey thanks, i actually managed to fix it a while ago and i had the same problem, i still don't know what happened but eh, unity gets weird sometimes i suppose, but thank you, really!
Can you help my enemy just gets really small
Instead of using " new Vector2( 1 , 1 ) " try using " new Vector2(3, 3) " . It depends on the initial scale values of your sprite.
@@stefanventer575 yeah I was dumb I learned alot thanks thou
how would you do this with the y axis
Can you guys help enemy just floats through the floor both have box colliders and their not set on trigger.Help!!
This Is My Other Acount For Real I Was Just Trippin What Happened Was I Downloaded A Asset Pack And it fuked up my layers So All I Had To Do Was Change The Layer To Ground Also Great Video My G, [:
Damn Son Where'd ya find this
I keep getting the popup Rigidbody2d does not contain a definition for Velocity. I dont understand why, can somebody help me here?
hey Mark, 'Rigidbody2D' (capital D)
I get error on this code distanceToPlayer = Vector2.Distance(transform.position - player.position); //Vector2 is an ambiguous reference between 'System.Numerics.Vector2' and 'UnityEngine.Vector2'. How to fix this?
You may have accidently imported the numberics library at the top of your file.
Thank you John Wick!!!
what happened to videos on your grid system ?
It doesnt recognize Player in the current context, can you help me fix this?
Ok so the way I "simply" fixed this is, refrence the rb in your public class, then in start, player = GameObject.Find("Player").GetComponent(); please let me know if there is a better way of doing this.
Ok so I have a new issue, my enemy is patrolling, yet as it moves back and forth the distance print changes briefly and then stops, not showing the constant dis between the two.
Update! I did literally nothing and the print dis problem is gone.
how can someone hate this tutorial???
thanks!
Tnx so mush good video
when i do prefab the enemy forget about player (None Transform)
INSANE thks you !!
Good Tips
The moment when I'm following along with this tutorial and my enemy stop chasing my player when I get outside of the agro range even though I haven't written any code for StopChasingPlayer() XD
Thank you man
my enemy shrinks when he is chasing me
I know this comment is a bit late but if anyone can help plz do it..so the problem is my enemy squeezes when the player enters the range.other than tht everything works fine
That's awesome!
Thanks!
this is the third video I watch to code a damn aggro, nothing worked, the enemy is standing still doing nothing. What can it be?
A very useful video it helped me make my aggro script for the enemy to chase my player
attaching the script of the look at player part please let me know what you think
//turn towards player and face player till out of range
if (Vector3.Distance(_transform.position, transform.position) < 20f)
{
transform.localScale = new Vector2(-1, 1);
}
if (transform.position.x < _transform.position.x)
{
transform.localScale = new Vector2(1, 1);
}
Thanks
the code works perfect, but the enemy falls so slow any hint?
It is a bit late but just change Vector2(moveSpeed, 0) to (moveSpeed, rb2D.velocity.y)
@@RandomDev77 Yes, I already noticed, but I hope it helps someone else, thanks
thanks bro !
You're welcome man
I love You, you are amazing
It is working. The problem is when the enemy is falling and following the player it looks like flying.
I fixed this. I just add raycast that check if the enemy is on the ground and if it isn't then his vertical velocity will be on negative value.
Butter than Brockey
Thanks thanks thanks thanks thanks thanks thanks thanks thanks
Underrated
where is the code
you remind me of john wick
for a cleaner script. "don't" serialize the variables, and instead start each with "public" (including the rigidbody2d) and instead of the GetComponent with the rigidbody2d (in the start function), just add the same way you did with the player transform. hope this helps.
I respectfully disagree with everything you have just proposed. Making things unessessary public pollutes the scope. There is also no issue with retreiving components in the start up functions. It's how they were designed to be used.
uhh...
okay
@@LostRelicGames I'm confused what exactly making things serialized is, what's the difference between it and public?
12:10 Get the f....
lmaooo
TURNNNN ON DARK MODE PLEASEE
No u
11:50 :D
Hero
I love you
idk why but it just didnt work
NOICE
You meant nice, right?
@@ZiaurRahmanAdvocate its a slang for nice
Thanks
Thanks