Click To Move | Unity RPG Tutorial #1

Ойын-сауық

The first part of a series where we'll be making a top down/isometric controller similiar to games like league of legends, runescape and diablo!
3D Models ► quaternius.com/
Project Download ► github.com/ItsPogle/Unity-Mou...
Discord ►► / discord
Twitter ►► / itspogle
Intro: 0:00
Setup: 0:21
Input Actions: 1:16
Navmesh: 1:55
Player Controller: 2:14
Camera Controller: 6:05
Particle Effects: 6:54
Outro: 7:49
#indiedev #unity #gamedev #gamedevelopment #indie

Пікірлер: 43

  • @metamorf9247
    @metamorf92474 ай бұрын

    It's probably too late to give advice, but for those who stumble upon this video, I recommend turning on DESTROY in the effect tab in "Stop actions" so that the effects are removed

  • @Patterno96
    @Patterno968 ай бұрын

    Great video! Thanks a lot for the great explanation, that's what I was looking for!

  • @Mogg798
    @Mogg7988 ай бұрын

    Good tutorial, had a couple problems with implementing it in my project, here is how i fixed if anyone has similar issue: Had an issue with Input.mousePosition in PlayerController script not being read, I had to go into player settings (Edit > project settings > player) and find the Active Input Handling dropdown and select "both". This fixed my errors but player wouldn't move on mouse click, as I didn't have any clickable layers set so, for temporary testing I just went to the inspector of the character and changed the clickable layers to "everything".

  • @leerc7721

    @leerc7721

    6 ай бұрын

    omg thank you so much Mogg! 😃

  • @AsherKadmiel
    @AsherKadmiel4 ай бұрын

    at first it wasn't working but then i realized that i had to select the default layer for the player controller script, Thanks !

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

    Easy, clean and very easy to follow!! Subscribed :D

  • @Pro-xm8jb
    @Pro-xm8jb Жыл бұрын

    Ur amazing its a crime how underated dis is

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

    Nice work👍🏻

  • @farbod376
    @farbod37610 ай бұрын

    if you face the code problem where your player reset rotation on arrival you can use this in void FaceTarget() function instead = void FaceTarget() { if (agent.velocity != Vector3.zero) { Vector3 direction = (agent.destination - transform.position).normalized; Quaternion lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z)); transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * lookRotationSpeed); } }

  • @nikson12gg

    @nikson12gg

    7 ай бұрын

    Perfect

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

    This is cool

  • @Nomike2212
    @Nomike22129 ай бұрын

    hey man can u make more of this series please

  • @phlovejoy
    @phlovejoyАй бұрын

    If Input Actions does not appear on your create list, return to package manager and download Input System from Unity Registry.

  • @King88Martyn
    @King88Martyn11 ай бұрын

    Thanks for the tutorial. How would you go about expanding this to continually move towards the mouse if you hold the button down? Similar to in Diablo.

  • @Its_Pogle

    @Its_Pogle

    11 ай бұрын

    If you're using the new Input System like this video, check out this approach. stackoverflow.com/questions/59837392/how-to-repeat-function-while-button-is-held-down-new-unity-input-system. Otherwise, if you're using the old Input System add this to update... if(Input.GetMouseButton(1)) { ClickToMove(); }

  • @King88Martyn

    @King88Martyn

    11 ай бұрын

    @@Its_Pogle Thanks, I'll give it a go.

  • @Semikaze

    @Semikaze

    11 ай бұрын

    I can help if you still have the problem. But diablo need the original old input system that i also use :) I have a ready script and you just need to adjust some things in navmesh agent. simple

  • @vastril5391
    @vastril53914 ай бұрын

    Hi I have a problem where the character does reach the destination, but lags behind and teleports as the animation happens. It does arrive yes but it does that where it is buggy and laggy. It does work perfectly though when clicking the area and it arriving there.

  • @AlejandroMartinez-iz2kf
    @AlejandroMartinez-iz2kf9 ай бұрын

    Hola, estoy desarrollando un videojuego estilo RPG y me he encontrado con el problema de los pisos superiores e inferiores, al buscar diferentes formas de fade, transparect, etc. no encuentro la solución deseada, alguien ofrece el servicio para que me ayude a solucionar mi problema?

  • @farbod376
    @farbod3769 ай бұрын

    my player controller somehow stopped working! it was all good , i cant figure out what happened,i even created a new project watch the tutorial few times to make sure i get everything right, it wont even work in the new project too! how come it was working few hours ago and wont work anymore , what is wrong with unity ? please help me

  • @GreenuniverseEuro
    @GreenuniverseEuro3 ай бұрын

    no matter what I click or do ClickToMove(); never gets called??

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

    Why am I not seeing navmeshsurface? I am getting an error on the environment game object. saying there is a missing script.

  • @Its_Pogle

    @Its_Pogle

    Жыл бұрын

    You'll have to download the 'com.unity.ai.navigation' package to see the script.

  • @shinosmodspot4267
    @shinosmodspot42672 ай бұрын

    i cant figure any thing out would u help me pog?

  • @Oathkeeprr
    @Oathkeeprr26 күн бұрын

    if anyone is having an issue with the character's FaceTarget snapping after they stop moving. simply check to see if the velocity is zero. and if it is just return. void FaceTarget() { if (agent.velocity == Vector3.zero) return; Vector3 direction = (agent.destination - transform.position).normalized; Quaternion lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z)); transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * lookRotationSpeed); }

  • @ukaszgrabski2811
    @ukaszgrabski28115 ай бұрын

    Add remaining distance checking in FaceTarget so it does not rotate like an idiot in the end :P

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

    After I did the code, I noticed that when the player object gets to the click position, say he is facing right, once he arrives to the spot I cliked he faces left (or to the front i guess), anyway to fix this.

  • @Its_Pogle

    @Its_Pogle

    Жыл бұрын

    I've run into this error when creating this system too. You may have made a mistake within the FaceTarget(). Double check it or just copy it from the github link!

  • @issykidding

    @issykidding

    Жыл бұрын

    Sorry, I realized that this is not an issue, but just how the code works. edit: Going to just edit this instead of putting a new comment. I figure out how to make the character stay in the same direction you move. Put the variable Vector3 direction at the top with the movement variables. Move the "direction = (agent.destination - transform.position).normalized;" to the ClicktoMove function. That way it will keep the direction until the mouse is clicked again.

  • @joaofrugiuele3588

    @joaofrugiuele3588

    11 ай бұрын

    @@issykidding Just change FaceTarget call from Update to ClickToMove and crank up LookRotationSpeed for 80 times

  • @joaofrugiuele3588

    @joaofrugiuele3588

    11 ай бұрын

    Another solution I just found is to put 'if(lookRotation.x != 0 || lookRotation.y != 0)' inside FaceTarget function, right above transform.rotation command

  • @voidvisiongames

    @voidvisiongames

    11 ай бұрын

    @@issykidding genius, thanks

  • @CaptinnDuckPlus
    @CaptinnDuckPlus11 ай бұрын

    when I start the game the camera goes underground, I don't know how to fix it.

  • @Its_Pogle

    @Its_Pogle

    11 ай бұрын

    Make sure the offset Vector3 reference on the Camera Controller is given values (6 on Y and -5 on the Z)

  • @CaptinnDuckPlus

    @CaptinnDuckPlus

    11 ай бұрын

    @@Its_Pogle I got it working

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

    I cant find AI Navigation package kinda unlucky gg

  • @abuuk

    @abuuk

    Жыл бұрын

    Its built in, go Window > Ai > Navigation

  • @aes0p895
    @aes0p8959 ай бұрын

    you go through these steps way, way too fast. and the fast forwarding is really frustrating.

  • @Vintosexe
    @Vintosexe9 ай бұрын

    I 'm so sick of it ! again I did everything as in the video and again it does not work ! your build is also not working as usual for everyone on KZread

  • @TheButteryGorilla
    @TheButteryGorillaАй бұрын

    ive used a character from the pack that you used but i cant find the avarat for it for the animation controller @PogleDev

  • @Lodreus
    @Lodreus5 ай бұрын

    I'm getting error on input.Main.Move.performed += ctx => ClickToMove(); "Severity Code Description Project File Line Suppression State Error CS1061 'CustomActions.MainActions' does not contain a definition for 'Move' and no accessible extension method 'Move' accepting a first argument of type 'CustomActions.MainActions' could be found (are you missing a using directive or an assembly reference?) Assembly-CSharp

Келесі