Point and Click Movement || Unity 2021 Tutorial

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 53

  •  2 роки тому +5

    Fantastic brother!! Please do more rpg style tutorials. Love it! Helped me a lot!!

  • @mahantesh1243
    @mahantesh1243 3 роки тому +1

    Exactly what i was looking for, how to make camera follow the character and input with touch instead of mouse.

  • @itseddo
    @itseddo 2 роки тому

    thank you so much, im working on a point and click for my course and I couldnt figure this out thank you jesus christ i needed this

  • @windy-autumn
    @windy-autumn 9 місяців тому

    Great tutorial! Very understandable! Thank you so much!! Keep it up! ☺

  • @AXISMotionStudio
    @AXISMotionStudio 3 роки тому

    Thank you for the video

  • @micol04
    @micol04 2 роки тому +3

    please help. everything works. but when player reaches the red sphere. i checked my animation and player is not going back to idle instead the animation is moving still between idle and walking

    • @ElGabroVero
      @ElGabroVero 10 місяців тому

      Hi! Im new to game making and im following along this video. Did you try to set stopping distance to some value?

    • @micol04
      @micol04 10 місяців тому

      @@ElGabroVero yes. I ended the project as it couldn’t be fixed. But thanks for your response

    • @ElGabroVero
      @ElGabroVero 10 місяців тому

      @@micol04 Sorry to hear about that :( wish you luck for the future, man!

  • @robobeans6339
    @robobeans6339 3 роки тому +1

    Great tutorial, thanks a lot!

  • @hophuoctin1669
    @hophuoctin1669 Рік тому

    Why does my character when approaching the destination run around it?

  • @leornoc608
    @leornoc608 Рік тому

    Didn't work for me, code was fine but the fing orb did nothing to make my char move.
    Really well explained however, shame to see there's not been anymore videos.

    • @TheCrownLP
      @TheCrownLP Рік тому +1

      deactivate the collider of the capsule that workt for me

  • @leerc7721
    @leerc7721 11 місяців тому

    How is the player rotating when you move? my character does not face the target

    • @ElGabroVero
      @ElGabroVero 10 місяців тому +1

      Hi! I had the same problem too! There is a variable to set sotpping distance! Try with 0.5 for example

  • @leerc7721
    @leerc7721 11 місяців тому

    The animation does not change from idle to walking when I move the character :(

    • @leerc7721
      @leerc7721 11 місяців тому

      actually my mistake, I had the wrong animator selected on the script component, its working for me now. Thx for the vid :)

  • @hyioxh5247
    @hyioxh5247 3 роки тому

    hey could u make a tutorial with simple puzzles like ur game "tharn" pls i need it

  • @cyber.punch.studios
    @cyber.punch.studios Рік тому

    Hello, why does the player continue to play the walking animation for half a second when reaching the destination?

    • @olwesTayerd
      @olwesTayerd Рік тому

      hello, do you have a fix for this?

  • @DJSikosis
    @DJSikosis 3 роки тому +1

    I have two problems. 1) I don't have a flat surface and the character never stops walking (ie. player velocity is never zero) and 2) player walks through obstacles. Do I have to add those objects to some layer to stop that?

    • @DJSikosis
      @DJSikosis 3 роки тому

      Figured out how to make the player not walk through obstacles by adding them to "Not walkable" under Object ... and I put the player on a flat plane but it still never stops walking.

    • @_D3adB0y_
      @_D3adB0y_ 3 роки тому +1

      I had the same damn problem lol. I figured out what to do though:
      public float stopDistance = 1;
      add this after player.SetDestination:
      player.stoppingDistance = stopDistance;

    • @stephenhenderson7546
      @stephenhenderson7546 Рік тому

      @@_D3adB0y_ thank you so much

  • @arasayproductions3727
    @arasayproductions3727 3 роки тому

    1:52 Bake is grayed out for me.

  • @creationJeuxVideoETtuto
    @creationJeuxVideoETtuto 3 роки тому

    hello from french.
    thank you for tutorial, he help me ^^
    like.
    since 7 months, no video. are you ok ? you are busy ?

  • @machonation7459
    @machonation7459 2 роки тому

    great! subbed

  • @micol04
    @micol04 2 роки тому

    PLEASE someone help. when my player gets on the target destination sphere, it begins to loop between walking and stopping animation. anyone knows why?

    • @mattwester9093
      @mattwester9093  2 роки тому

      I would guess that the issue lies in your animator controller, possibly the way you transition between the two animations? If not that, double check that there is no collision on the target destination sphere preventing the player from fully reaching the destination

    • @stephenhenderson7546
      @stephenhenderson7546 Рік тому

      @@mattwester9093 i have same problem I even completely removed the Sphere

    • @cademarsh5097
      @cademarsh5097 Рік тому

      Not sure if you ever fixed this issue, but I would make sure on your Animator that the "Apply Root Motion" is not check marked.

    • @micol04
      @micol04 Рік тому

      @@cademarsh5097 I unchecked it but abandoned the project anyway for another. Thanks

  • @LeetardPlays
    @LeetardPlays 2 роки тому

    Any idea as to why the player won't move? I'm kinda goosed atm. I'm no programmer or Unity fanatic

    • @emilythebaptist
      @emilythebaptist 11 місяців тому +1

      hey buddy

    • @LeetardPlays
      @LeetardPlays 11 місяців тому +1

      Ah. I see we meet again​@@emilythebaptist

    • @emilythebaptist
      @emilythebaptist 11 місяців тому

      @@LeetardPlays Just got it to work! hope it goes well for u

    • @LeetardPlays
      @LeetardPlays 11 місяців тому

      @@emilythebaptistI disliked this comment

  • @baorieartdev4226
    @baorieartdev4226 2 роки тому

    For some reason my target destination object (sphere) wont appear where i click. it stays below the scene, and if i move it and click on it, my character walks to it. but i cant get it to change its transform. any help? my code is exactly the same :(

    • @mattwester9093
      @mattwester9093  2 роки тому

      Seems like there is an issue with adjusting the transform of the sphere. Just to be safe post your code here so I can take a look, and double check that all variables are properly assigned.

    • @baorieartdev4226
      @baorieartdev4226 2 роки тому

      @@mattwester9093 using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.AI;
      public class CharacterControl : MonoBehaviour
      {
      public Camera cam;
      public NavMeshAgent player;
      public Animator playerAnimator;
      public GameObject targetDest;

      // Update is called once per frame
      void Update()
      {
      if (Input.GetMouseButtonDown(0))
      {
      Ray ray = cam.ScreenPointToRay(Input.mousePosition);
      RaycastHit hitPoint;
      if(Physics.Raycast(ray, out hitPoint))
      {
      targetDest.transform.position = hitPoint.point;
      player.SetDestination(hitPoint.point);

      }
      }



      if (player.velocity != Vector3.zero)
      {
      playerAnimator.SetBool("isWalking", true);
      }
      else if (player.velocity == Vector3.zero)
      {
      playerAnimator.SetBool("isWalking", false);
      }
      }

      }

    • @baorieartdev4226
      @baorieartdev4226 2 роки тому

      @@mattwester9093 its weird, because it almost works. Just the sphere doesnt move at all by itself. I have to move it in the game window, click on it, and she moves to it. but it wont spawn. i have all four variables assigned, camera, player (navmeshagent), player (animator), and Target Destination object. I even tried the code on the Unity website, and like two other videos and that didnt work either lol

  • @RodnnySniperLyfe
    @RodnnySniperLyfe 2 роки тому

    Any Reasons Why when the character reach his destination it will start walking in circles around the sphere?

    • @pebbu7435
      @pebbu7435 2 роки тому

      I'm guessing the sphere has a collider that stops the character from actually reaching the destination, so he walks circles around

    • @NemesisIrae
      @NemesisIrae 11 місяців тому

      I had the same issue. I think it depends on the walking animation if the velocity of the agent can drop to zero (and the animation goes back to idle). I used a float variable in the control script as a minimum distance threshold and it works fine now.
      [SerializeField] float minDistanceToTarget = 0.1f;
      // in Update() instead of checking the velocity:
      if (player.remainingDistance > minDistanceToTarget) { animator.SetBool("isWalking", true); }
      else { animator.SetBool("isWalking", false); }

  • @magoblancoel
    @magoblancoel 2 роки тому

    Thanks!!!!!!!!!!!

  • @zhengmay5915
    @zhengmay5915 2 роки тому

    Hi matt I cant open your website

    • @mattwester9093
      @mattwester9093  2 роки тому

      Hey sorry about that. I'm tracking the issue, but unfortunately I'm getting on a plane and won't be able to fix it until later today

    • @mattwester9093
      @mattwester9093  2 роки тому

      Thank you for your patience, the issue should be fixed now, but please allow up to 48 hours for the servers to apply my solution:)

  • @purrple_chanuwu3063
    @purrple_chanuwu3063 3 роки тому

    tharn game???

  • @monsterblood4209
    @monsterblood4209 2 роки тому +1

    script doesn't work anymore, don't bother

    • @mattwester9093
      @mattwester9093  2 роки тому

      As far as I know this script still works fine. Could you post any errors you have?

  • @islamdjaid9817
    @islamdjaid9817 3 роки тому

    thnxxxxxxxx