Unity Playmaker Tutorial - FPS Character Controller - Movement

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • In this video I go through the basics of making a character controller using Unity's built-in Character Controller and Playmaker.
    Going through the steps of using Unity's axis to move the character, creating our own gravity, and using the mouse to look around.
    I have my mic placed a bit close to the mouse, so you'll hear me slamming that left mouse button real hard. Sorry about that.
    Next video will be about jumping and checking if "grounded".
    NOTE:
    I forgot to mention that the 'mouse look' action that tilts the camera should have a minimum and maximum angle of rotation, otherwise you'd be able to tilt the camera upside down. Something for the next video I suppose.
    Background music used, Ninri - Quasar
    Can be found on Newgrounds: www.newgrounds...
    RUclips: • Quasar
    Spotify: open.spotify.c...
    And various other music outlets.

Комментарии • 89

  • @FictitiousCtrlGames
    @FictitiousCtrlGames 3 года назад +7

    For Referencing Later
    Get Axis: 9:15
    Controller Move: 11:30
    Set Vector XYZ: 12:42
    Gravity: 15:29

    • @OneMonthStudio
      @OneMonthStudio  3 года назад +1

      Nice work!

    • @FictitiousCtrlGames
      @FictitiousCtrlGames 3 года назад +2

      @@OneMonthStudio Thank you. :) It was more for myself, than anything. I watched your tutorial and made the controller, but after deleting it and trying to remake it for practice, I totally forgot. lol But I think I got the gist of it now.
      Now I have to figure out how to make a gun shoot. Whats the best method for that?
      Raycasting or something less expensive on cpu?

    • @OneMonthStudio
      @OneMonthStudio  3 года назад +1

      @@FictitiousCtrlGames Hmmm, I might make a tutorial on that soon.
      I have a few methods of doing shooter mechanics, both with bullets and raycasting.
      So be on the lookout for that very soon.

    • @FictitiousCtrlGames
      @FictitiousCtrlGames 3 года назад

      @@OneMonthStudio Awesome! I'm excite!

  • @_____J______
    @_____J______ 2 года назад +1

    Finally. After one day waste of following out of date or not working tutorials this is gold

  • @DenOvsyannikov
    @DenOvsyannikov 5 лет назад +12

    Very nice and helpful tutorial, thank you!

  • @lraxious
    @lraxious 3 года назад +1

    Thanks for the tutorial, I learned a lot as a beginner!
    Also, to fix the camera when looking directly straight up or down just:
    Set the "minimum Y and maximum Y" of the Mouse Look - Camera to -90 and 90 respectively.

  • @davidpreston1155
    @davidpreston1155 2 года назад +1

    Super tutorial , a big Thank you ,, :)

  • @xxxx-eh1vu
    @xxxx-eh1vu 3 года назад +1

    Thanks for great tutorial. But I have a question.
    How do I make stop moving if I press the A key after I press the D key? (Also in the opposite case)

  • @RomboRosso
    @RomboRosso 4 года назад +1

    Thank you very much for this tutorial!

  • @garywilkerson6395
    @garywilkerson6395 4 года назад +1

    This is a great tutorial, thank you. Any tips on applying the mouselook to extend to a gamepad?

  • @virusocyrus
    @virusocyrus 4 года назад +1

    is there anything on looping a sound (footsteps) on button down? im having problems..

  • @everjn17
    @everjn17 3 года назад +1

    On 25:05, why do you assign the X and Z value to None ? I suppose it should have assigned axisHorizontal to X and axisVertical to Z doesn't? i am not really sure what i didn't grasp here

    • @OneMonthStudio
      @OneMonthStudio  3 года назад

      Good question.
      We assign the axisHorizontal and axisVertical to the axisVertical vector3 as we did above, otherwise we won't be able to clamp it's magnitude. Because if we only do it once within our movementVector, even gravity will be clamped and that's what we're trying to avoid.
      So you need to assign the axis floats to a separat vector3 and clamp it, to then assign that clamped vector3 to a different vector3 by using 'Set Vector3 XYZ', and assign gravity to our new vector3's Y component.
      All to avoid clamping gravity to 1.

  • @PabloYaos
    @PabloYaos 4 года назад +1

    Great tutorial thanks for the help!
    related question : how would I go about having the character controller move slower when going backward ?

  • @HungNguyen-rx4gh
    @HungNguyen-rx4gh 4 года назад +1

    The tutorials are awesome! Thank you so much! Can you make a 3rd person controller tutorial? I'd buy that in a heartbeat.

  • @weisean3370
    @weisean3370 2 года назад +1

    thanks!! its useful!!

  • @andrewcondon3027
    @andrewcondon3027 5 лет назад +1

    Learned a lot! Thank you!

  • @zap54312
    @zap54312 2 года назад

    out of curiosity, Where did you find that Complete Control thing? I can't find it anywhere.

    • @OneMonthStudio
      @OneMonthStudio  2 года назад

      It's an addon called Input Manager CC. It requires a little bit of tweaking to get it to work, but it's a handy input manager addon.

  • @magkunch4763
    @magkunch4763 4 года назад +1

    Thanks you very much for tutorial😘😘😘😘

  • @viva-la-baz1458
    @viva-la-baz1458 4 года назад +1

    Great tutorials, any advice going for a head bob with the camera?

    • @kurioman
      @kurioman 2 года назад

      add a simple script : when player move -> move the camera (value=they way u want to);

    • @kurioman
      @kurioman 2 года назад

      Dont forget to loop it + Force finish animation/the loop before to listen if the player is moving and start a new loop

  • @PowerUpT
    @PowerUpT 4 года назад

    I am trying to use your tutorial with Unity 2019, and I installed the input manager and Playmaker. However, the actions for Playmaker don't seem to come with the input manager, and I can't find anything about this anywhere. First, should I use the version of Unity that you're using if it's broken in newer versions, and is there somewhere that I should be looking for a plugin for Playmaker that makes the input manager work with it?

    • @sneakerninja
      @sneakerninja 4 года назад

      try hitting reset on the input manager, go to Edit, then project setttings, look for the cog icon in the top right, click it and hit reset

    • @OneMonthStudio
      @OneMonthStudio  4 года назад

      Just use the built-in input manager, and use the standard input actions in playmaker.
      The input manager that I use is broken in newer version of unity, so I'd just use built-in input manager.

  • @ShadeCOD
    @ShadeCOD 3 года назад

    Im able to move and turn my camera but when I walk and turn my camera the direction Im walking doesnt change. What can I do to fix that?

    • @OneMonthStudio
      @OneMonthStudio  3 года назад

      Remember to set the mouselook that pans the camera horizontally to only affect the playercharacter and not the camera. Since we've got the camera as a child of the player, when the player turns, the camera will turn with the player.

  • @jaanekborodajev5654
    @jaanekborodajev5654 3 года назад

    Can you do tutorial about Animations please. wana know how animations work with FPS examples.

  • @sneakerninja
    @sneakerninja 4 года назад +3

    Gravity at 15:29 to 20:58

  • @kurioman
    @kurioman 2 года назад +1

    Get Axis didn't worked for me, i pressed all my keyboard&mouse, The character didn't wanna move..

    • @kurioman
      @kurioman 2 года назад +1

      Okay so i had to install the new input system (Available in Package manager for free, like Probuilder)
      But i had the vjoy error. so i just have to update it to the latest version available atm (1.2.0)
      Now everything work like a charm, thanks for the tutorial !

  • @westingtyler1
    @westingtyler1 5 лет назад +2

    nice, but you should explain WHY dragging an object into the fsm window is bad, rather than just saying it's bad.

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +4

      Hi, sure can.
      It's a bad habit because then it relies on the object being in the scene in the first place, this plays badly with prefabs.
      If we tell our script to look for a specific object, we can use it during create object or object pooling (spawning object for later use).
      We tell the script what to look for within the scene based on a name and a tag, and thus we don't have to rely on it being the same object every time. We can change the object, without having to keep dragging it into the action.
      Hope that clears things up.

    • @westingtyler1
      @westingtyler1 5 лет назад +1

      @@OneMonthStudio cool. on a similar note, is it better to use "find object" to gather game objects upon scene start, or is it better to assign them to a variable in the fsm? when you say, "dragging onto the fsm window" are you referring to what you showed, or also dragging it into the variables tab to create a new named variable, then using that? I heard that using the Find Object is really expensive, so I've been dragging them into the VARIABLE WINDOW to create the variables ahead of time that way, rather than using Find Object.

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      @@westingtyler1
      Yes using 'Find Object' is expensive, and that is why we only do it once every now and then. Best used at the start of the scene, or sparingly. Same goes for creating objects that aren't pooled, that will cause a frame stutter as the information is written to ram from harddrive.
      By "dragging into the fsm window" I mean any variable that relies on a specific object, because in most cases you want it to be dynamic. So yes, both what I showed and into the variable window.
      But because 'Find Object' is kinda expensive, we only use it sparingly, and for things that are dynamically changing.
      It's just a bad habit to rely on some objects to be within the scene. If you wanted to create an object later, you'd need to look for it or set up an elaborate maze of a script to send the created object to whatever needs it.

  • @timothygottlieb2013
    @timothygottlieb2013 5 лет назад

    so I followed your tutorial which btw is great. but i ran into a snag.
    my y camera movement was inverses(when mouse was moved up camera went down and vice versa) when i put the positive 2 where you had it for the camera look.
    the obvious fix was inverting the value to get the desired effect.
    but i was wondering if that was a bug just for me or do you use inverse y axis for most games you play.

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      Might be a bug with one of the actions, try one of the other mouse look action/s, I think Playmaker comes with 2 different ones.

  • @GerwaldJensRadsma
    @GerwaldJensRadsma 5 лет назад +1

    Thank you so very very much!

  • @Z18-i3n
    @Z18-i3n 4 года назад

    Can i use get axis vector instead of get axis with set vector?

  • @jaanekborodajev5654
    @jaanekborodajev5654 3 года назад

    You not use Magnitude, for make Animations for Player.

  • @shushischannel3826
    @shushischannel3826 5 лет назад +1

    I can not find hardshell in unity 2019 version. Please advise. Thanks.

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +2

      I said I was using a thirdparty input manager, yours would be just the regular input actions like 'get axis'.

  • @bluebird5738
    @bluebird5738 3 года назад

    thanks for this tutorial ,but scripting is easer and faster , can be done within 8 lines of simple codes to do all of that actions ..

  • @NabilMajid
    @NabilMajid 5 лет назад +2

    how can i attach to a virtual joystick?

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      Not sure, you'd probably have to get something off the assetstore for that.

  • @38procentkrytyk
    @38procentkrytyk 3 года назад

    The child didn't work for me... however the big "nono" actually did... so I guess I'm a sinner.

    • @OneMonthStudio
      @OneMonthStudio  3 года назад +1

      Setting variables isn't so much of a "nono", but less flexible if you want the variable to be set dynamically.
      Say if you're building a game out of chunks, where you load parts separately, then you can't rely on setting the variable beforehand, you'd have to look for what to fill that variable with at runtime.
      Remember to get a child that has the right tag and name, otherwise you're not going to find the child you're looking for.

    • @38procentkrytyk
      @38procentkrytyk 3 года назад

      @@OneMonthStudio Thank you sir. Everything now works because now I understand how this system works. I thoughts the opposite was true. The name was the new name for the object we look for as a child.
      Some name changing so it would get less confusing and it works.

  • @androidemulation5952
    @androidemulation5952 4 года назад

    excuse me, could you help me here? I did something similar to what did and everything worked fine except for one. when I rotate the mouse the player doesn't rotate. so when I move the camera to the right and press (W) the player move to the left.
    I didn't use a rigidbody to freeze the axis and I can't think of any other reason it didn't work. any help is much appreciated.

    • @androidemulation5952
      @androidemulation5952 4 года назад

      it seems like that the player is rotating, But the movement vector is not related to the direction the character is facing

    • @androidemulation5952
      @androidemulation5952 4 года назад +3

      oh, it seems that the problem was caused by the character controller component. Space had to be (self) for the movement vector to be relative to the player, not the world

    • @ivehadenough3030
      @ivehadenough3030 4 года назад +1

      @@androidemulation5952 Thanks I had this problem to and that fixed it.

    • @androidemulation5952
      @androidemulation5952 4 года назад

      @@ivehadenough3030 Glad it helped

  • @edcosine
    @edcosine 5 лет назад

    OMG I followed everything, but somewhere I must have missed something because, I'm able to move the camera left and right with the mouse, but it won't go Up and Down. Any suggestions?
    I keep rewatching the video and just can't seem to pin-point where I messed up at.

    • @edcosine
      @edcosine 5 лет назад

      Ok, it looks like for some reason, under the "Mouse Look - Player" when I make adjustments to the sensitivity of the "Mouse X," it changes the sensitivity of the Y axis. I clearly have the X set to a value and the Y to zero, but it seems to be reacting to the Y Axis for some reason.

    • @edcosine
      @edcosine 5 лет назад +1

      I figured it out!!!!! LOL
      Under the "Get Child" action, I had the "Child" name wrong. when I corrected it, everything worked correctly!

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      @@edcosine 👍

    • @edcosine
      @edcosine 5 лет назад

      @@OneMonthStudio Ok, I'm heading over to the second video. So excited !!!

    • @Cordsi_Games
      @Cordsi_Games Месяц назад

      @@edcosine u so lucky man im having your issue to bro i cant look up and down. the child name for me isnt wrong :(

  • @ziyedhamrouni886
    @ziyedhamrouni886 5 лет назад +4

    please make a third person controller

  • @Sparclen
    @Sparclen 4 года назад +2

    THanks for the effort, but PLEASE write yourself a script first next time. 75% of the time you're just rambling, unsure about what to say next. It's quite excruciating.

  • @ZeroRaxo
    @ZeroRaxo 5 лет назад +1

    Gravity doesn't work for me

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      It should if you did it as I did.

    • @KimCucnailshopduncanville
      @KimCucnailshopduncanville 5 лет назад +1

      @@OneMonthStudio Which keywords to move forward. I only can move left (A letter), Move right (D). Backward and forward can not.

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад +1

      @@KimCucnailshopduncanville Forward and backwards is 'Vertical', while sideways is 'Horizontal'.

  • @gustas.pikturna631
    @gustas.pikturna631 4 года назад

    mine is not moving
    i followed every step but no good but the tutorial is understandable

    • @notchedbandit
      @notchedbandit 3 года назад

      Did you ever manage to fix this problem? I'm having the same problem and I tried everything.

  • @bobdawkins7473
    @bobdawkins7473 5 лет назад

    What is hardshell ??

    • @OneMonthStudio
      @OneMonthStudio  5 лет назад

      It's an input manager, a useful tool if you don't want to use the built-in Unity input manager.

  • @DeadChannelLol
    @DeadChannelLol 4 года назад +1

    10,000th

  • @caroleancolonel7119
    @caroleancolonel7119 4 года назад +1

    Stop abusing ur Mose

    • @OneMonthStudio
      @OneMonthStudio  4 года назад +1

      Haha yeah I know.
      I had to place the mic close to the mouse for this record.

    • @caroleancolonel7119
      @caroleancolonel7119 4 года назад

      @@OneMonthStudio XD

  • @hahas507
    @hahas507 4 года назад

    말 진짜 ㅈㄴ 느리네