Hope you enjoy the video! The entire package for our enemy can be found on my Patreon: www.patreon.com/posts/92227715?pr=true Check it out to also get some free scripts, packages and sprites from previous videos - or support the channel and have access to the whole project! 💜
İ don't care about ur tutorials cuz im Professional in games Development but i love hearing ur voice hahah 🤣and support u cuz u r deserve that good luck
This is so good. However for my game, my enemy doesn't face towards the player when walking towards it. Could you make a tutorial addressing that part. Thanks
Try putting this code into your enemie's update function: float direction = Mathf.Sign(player.position.x - transform.position.x); //Gets direction of player spriteRenderer.flipX = direction < 0; //Flips enemy sprite If this flips it to turn the wrong way, change it to be: spriteRenderer.flipX = direction > 0; //Flips enemy sprite Hope this helps!
Have you tried debugging? You can stick breakpoints into your code and press the play button - then when the isGrounded is meant to be turned on/off you can try and see why it isn’t! Follow the code path and see what it could be! I can’t help much without seeing it sorry 🙏😣
I’d never thought of adding a jump scare to a 2D game! Guess it’d work the same as a 3D one: adding a sort of trigger that when the player walks on it makes an enemy pop out and play a sound effect 🧐 I’ll have a think about it and add it to the to do list! 🙏
I got this error in this code.. 69,19 CS1061 'Rigidbody2D' does not contain a definition for 'Addforce' and no accessible extension method 'Addforce' accepting a first arguments of type 'Rigidbody2D' seems like unity mentioned about rb = GetComponent(); and rb.Addforce(new Vector2(jumpDirection.x, jumpForce), ForceMode2D.Impulse); nevermind, f for F my bad. lmao xd
Hope you enjoy the video!
The entire package for our enemy can be found on my Patreon: www.patreon.com/posts/92227715?pr=true
Check it out to also get some free scripts, packages and sprites from previous videos - or support the channel and have access to the whole project! 💜
Have to admit the best one so far all other script didn't worked but now the enemy doing something (flothing)
İ don't care about ur tutorials cuz im Professional in games Development but i love hearing ur voice hahah 🤣and support u cuz u r deserve that good luck
Thank you for the support 😝 I’ll hopefully make some videos that aren’t just tutorials in the future that might be more interesting for you!
@@GameCodeLibrary we will see 👀
So good tutorial, also i like your voice, new subscriber i'm here to learn and support
So glad you enjoyed!! Thank you for the support :-)
My enemy doesn't detect the ground in front. All the other things work perfect, however, this one no.
This is cool!
Thank you
I’m glad you enjoyed!! I’ll keep making fun vids 😈
This is so good. However for my game, my enemy doesn't face towards the player when walking towards it. Could you make a tutorial addressing that part. Thanks
Try putting this code into your enemie's update function:
float direction = Mathf.Sign(player.position.x - transform.position.x); //Gets direction of player
spriteRenderer.flipX = direction < 0; //Flips enemy sprite
If this flips it to turn the wrong way, change it to be:
spriteRenderer.flipX = direction > 0; //Flips enemy sprite
Hope this helps!
the time section are from the old video btw. still, thanks for this tutorial
Woops you’re right!! I’ll redo the chapters now 😝 thank you! 🙏
I don't know why isGrounded is always false for me. I used Debug.DrawLine on it, and I think the Raycast on isGrounded isn't working. HELP 😭
I could finally get isGround to turn true, but when I lifted my enemy in the air, isGround was still true 💀😭
Have you tried debugging? You can stick breakpoints into your code and press the play button - then when the isGrounded is meant to be turned on/off you can try and see why it isn’t!
Follow the code path and see what it could be! I can’t help much without seeing it sorry 🙏😣
enemy jumpscare please 🙏
I’d never thought of adding a jump scare to a 2D game! Guess it’d work the same as a 3D one: adding a sort of trigger that when the player walks on it makes an enemy pop out and play a sound effect 🧐
I’ll have a think about it and add it to the to do list! 🙏
I got this error in this code..
69,19 CS1061 'Rigidbody2D' does not contain a definition for 'Addforce' and no accessible extension method 'Addforce' accepting a first arguments of type 'Rigidbody2D'
seems like unity mentioned about
rb = GetComponent();
and
rb.Addforce(new Vector2(jumpDirection.x, jumpForce), ForceMode2D.Impulse);
nevermind, f for F my bad. lmao xd