Enemy Patrolling Unity Tutorial

Ойындар

Enjoy the video, if you have any questions ask in the comments down below!
Request a tutorial here:
forms.gle/JLBkpHt1ZFLpn7TE9
Patreon with fully explained c# scripts:
/ blakeygames
Main Channel: / bblakeyyy
Join the Discord: / discord
Play my games! :
blakey-games.itch.io/
play.google.com/store/apps/de...
Watch me Live on twitch: / bblakeyyy
unity tutorial,unity,tutorial,unity 2d tutorial,unity ai tutorial,unity game tutorial,unity enemy tutorial,unity enemy ai tutorial,unity enemy ai,unity 2d,unity 2d shooting,unity tutorial 2d,unity tutorial for beginners,shooting,unity shooting,unity 2d game tutorial,unity 3d tutorial,unity enemy ai 2d,enemy,unity 3d,unity 2d shooting tutorial,unity shooting tutorial,tutorials,unity beginners tutorial,shooting tutorial in unity Audio used in my videos:
♪ Onion (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Branch (Prod. by Lukrembo)
Link : • (no copyright music) c...
♪ Biscuit (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Bread (Prod. by Lukrembo)
Link : • (no copyright music) j...

Пікірлер: 21

  • @morebblakeyyy
    @morebblakeyyy Жыл бұрын

    Apologies for youtube compressing the darker colours in this video, super annoying that it does that!

  • @RUDERUDYTUTORIALS

    @RUDERUDYTUTORIALS

    Жыл бұрын

    Its not so bad i managed to write the code down perfectly.

  • @OssiTov
    @OssiTov3 ай бұрын

    this is one of the best tut i`ve ever seen ty so much

  • @krishnasoni4829
    @krishnasoni48297 ай бұрын

    Thank you very very much Sir ❣️

  • @RUDERUDYTUTORIALS
    @RUDERUDYTUTORIALS Жыл бұрын

    Awesome tutorial sir. Can you please tell me how to make enemy chase player when in range of the enemy but with this function embedded thank you in advance.

  • @prosealien
    @prosealien10 ай бұрын

    Very well explained but, struggling with this one with a more update unity to what I was using, watched slowly few time stops after 1st cube wondering if there is a change in new Unity, x y and z same as way points basically duplicated all steps

  • @aiden1010
    @aiden10106 ай бұрын

    For anyone having trouble with this one: (Did this for 2D, but should work in 3D as well) In the start method I had to remove ** targetPoint = 0; ** statement otherwise it would reset to 0 after reaching the first targetPoint In the update method //instead of setting the game object position to be equal to the targetPoint position set it to, if the game object is within a (very) small distance if (Vector2.Distance(transform.position, patrolPoints[targetPoint].position) = patrolPoints.Length) { targetPoint = 0; } } transform.position = Vector2.MoveTowards(transform.position, patrolPoints[targetPoint].position, speed * Time.deltaTime);

  • @MalicProductions
    @MalicProductions Жыл бұрын

    I'm having trouble with this one. It seems as though once the enemy gets to the position of a waypoint it does not activate the if(transform.position == patrolPoint[targetPoint].position I am unsure as to why that might be, and am curious as to your thoughts.

  • @Wavero

    @Wavero

    11 ай бұрын

    guessing its something to do with the Y's not being the same, think you need to check if the X and Z position of the AI is the same as the waypoints and just ignore the Y, assuming you aren't going up ramps or anything

  • @jarrydoneill7834
    @jarrydoneill7834 Жыл бұрын

    How could I combine this with a chasing mechanic, and once the player is out of reach it'll go back to patrolling?

  • @Rptr797-wn4iu

    @Rptr797-wn4iu

    2 ай бұрын

    Yeah i need this answer

  • @PixelNoob01
    @PixelNoob012 ай бұрын

    Can someone help me how to draw a Gizmos Shpere for each point?

  • @Rptr797-wn4iu
    @Rptr797-wn4iu2 ай бұрын

    I'm getting an error when I use square brackets in "transform.position = vector3.movetowards(transform.position, patrolpoints[0].position, speed * time.deltatime;" can someone help Edit: I was using wrong variable nevermind

  • @mintVal
    @mintVal Жыл бұрын

    How can u make the Patrol bot returning in the same order as it came? not: 0,1,2 - 0,1,2 but: 0,1,2, - 2,1,0

  • @NoobDev14

    @NoobDev14

    Жыл бұрын

    do you have the solution to this now ?

  • @killerkaneossvr5471
    @killerkaneossvr5471 Жыл бұрын

    do you know how to make it so a sphere, in my case a character, look at the target points?

  • @azelwkr3841

    @azelwkr3841

    Жыл бұрын

    I'm not sure I understand but maybe you can use Transform.LookAT() function ?

  • @sweetpea2788

    @sweetpea2788

    Жыл бұрын

    lol im having the same issue because I added in an enemy FOV

  • @momoiman2677
    @momoiman2677 Жыл бұрын

    does it work in 2D?

  • @morebblakeyyy

    @morebblakeyyy

    Жыл бұрын

    Should do

Келесі