Alexander Zotov sir I want to copy that..so that it will save time and effort...
@AlexanderZotov6 жыл бұрын
GamerBOY !! You could have retyped it already while having this sweet conversation :-) It doesn't mean that I don't like to chat though ;-)
@gamerboy72166 жыл бұрын
Alexander Zotov I will follow you in Twitter chat there....ok sir
@frankinocuda2 жыл бұрын
Number One, please more tutorial thanks
@miguelmonreal.88745 жыл бұрын
Hello Alexander, i had a question, in the void update where did you get the -9 and 9 from? I think that's where i'm having my problem. I have my enemy chase, but he won't flip to face the enemy. I have the script set up with the facingRight, but it still won't switch sides. i would appreciate any help you can give me.
@MimiGunz5 жыл бұрын
same
@Ana-lm1gc4 жыл бұрын
I know I'm a bit late and you probably found a solution but if you didn't here is an explanation(and solution but I will explain it just so you know how to use it in your program): Those if and else if statment is the range where the zombie(in this case) will go, he did make a mistake there but here is an example of what i changed: if (transform.position.x < -1f) { dirX = 1f; } else if (transform.position.x > 25f) { dirX = -1f; } I want my player when he reaches the position -1 to turn and than every time i add +1f until he reaches 25 on x after that he turns back and he walks until he reaches -1. Hope it helps even tho I'm late for about a year :)
@junjielim1113 жыл бұрын
@@Ana-lm1gc whats the solution? i still cant solve it
@junjielim1113 жыл бұрын
your solution didnt work too
@PradeepKumar-kk4zd4 жыл бұрын
im the 100 like & thanks for the video
@TheRedflash7775 жыл бұрын
спасибо, что без лишней воды всё рассказал :)
@orhangunes39112 жыл бұрын
Thank u so much alexander follow u
@riccardomercatali70074 жыл бұрын
Can u please give me a link to copy the script? I think i did something wrong but i can't figure out what :/
@francinacolley26894 жыл бұрын
Why does my zombie move to the right but when it hits a corner it doesn't turn left but rather just starts to glitch?
@raidoksgames35104 жыл бұрын
You know why?
@junjielim1113 жыл бұрын
use box collider then
@orhangunes39112 жыл бұрын
void Update () { if (transform.position.x < -2f) dirX = 1f; else if (transform.position.x > 1f) dirX = -1f; if (isAttacking) anim.SetBool ("isAttacking", true); else anim.SetBool ("isAttacking", false); }where -2 and 1 indicate the destination and mark the border
@mykhailoshyshkin88046 жыл бұрын
Привет! Спасибо за новое видео, все супер! :)
@aldridgecrate50266 жыл бұрын
could you make video series on making clash of clan type game or plant vs zombies
@junjielim1113 жыл бұрын
hey man why does my zombie move left and when it hit the wall, it just glitched there and didnt turn right? Thanks!
@AlexanderZotov3 жыл бұрын
I don't know. Happy to help :-)
@AlexanderZotov3 жыл бұрын
I guess it's because you miss something
@junjielim1113 жыл бұрын
@@AlexanderZotov but i followed your script exactly the same dude xD
@AlexanderZotov3 жыл бұрын
May be you give your zombie wrong way points?
@junjielim1113 жыл бұрын
@@AlexanderZotov using System.Collections; using System.Collections.Generic; using UnityEngine; public class Enemy : MonoBehaviour { float dirX; [SerializeField] float moveSpeed = 3f; Rigidbody2D rb; bool facingRight = false; Vector3 localScale; // Start is called before the first frame update void Start() { localScale = transform.localScale; rb = GetComponent(); dirX = -1f; } // Update is called once per frame void Update() { if(transform.position.x 9f) { dirX = -1f; } } void FixedUpdate() { rb.velocity = new Vector2 (dirX * moveSpeed, rb.velocity.y); } void LateUpdate() { CheckWhereToFace(); } void CheckWhereToFace() { if(dirX > 0) facingRight = true; else if(dirX < 0) facingRight = false; if(((facingRight) && (localScale.x < 0)) || ((!facingRight) && (localScale.x > 0))) localScale.x *= -1; transform.localScale = localScale; } } Take a look if udm. i compared with yours and mine. its the same
@coversparty62506 жыл бұрын
Здравствуйте! Восхищаюсь вашими уроками. Скажите, где можно найти спрайты для зомби как у вас? Спасибо!
@AlexanderZotov6 жыл бұрын
Спасибо. www.gameart2d.com
@aonmuhammad43056 жыл бұрын
nice one but after a long time.
@AlexanderZotov6 жыл бұрын
I wish I had more time for KZbin. Family, regular job want me too)
@chariouibouchaib44166 жыл бұрын
Yes Family is the first , Thank you for your Hard Works Sir