How to SWAP your Character! (Change Mesh Visual, Same Animations, Controller)

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • 🌍 Get my Complete Courses! ✅ unitycodemonke...
    👍 Learn to make awesome games step-by-step from start to finish.
    👇 Click on Show More
    🎮 Get my Steam Games unitycodemonke...
    🔴 RELATED VIDEOS 🔴
    Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) • Kickstart your game wi...
    FREE Characters and FREE Animations for your GAMES! (Mixamo) • FREE Characters and FR...
    POLYGON City Synty cmonkey.co/syn...
    💬 Learn how to change a Character Mesh Visual while keeping the same Controller and Animations.
    Here I am demonstrating that process using Unity's FREE Third Person Starter Assets Controller but these steps work on any character controller for swapping any character visual.
    1. Change the SkinnedMeshRenderer
    2. Change the Bones
    3. Assign the new Avatar for the new Mesh
    Make sure the Bones have the correct name!
    🌍 Get Code Monkey on Steam!
    👍 Interactive Tutorials, Complete Games and More!
    ✅ store.steampow...
    If you have any questions post them in the comments and I'll do my best to answer them.
    🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
    See you next time!
    📍 Support on Patreon / unitycodemonkey
    🎮 Grab the Game Bundle at unitycodemonke...
    📝 Get the Code Monkey Utilities at unitycodemonke...
    #unitytutorial #unity3d #gamedev
    --------------------------------------------------------------------
    Hello and Welcome!
    I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.
    I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
    I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
    You can see my games at www.endlessloopstudios.com
    --------------------------------------------------------------------
    - Other great Unity channels:
    Unity - / unity3d
    Brackeys - / brackeys
    Dani - / @danidev
    Jabrils - / @jabrils
    BlackthornProd - / @blackthornprod
    Sykoo - / sykootv
    Jason Weimann - / @unity3dcollege
    Jonas Tyroller - / @jonastyroller
    --------------------------------------------------------------------
    - Website: unitycodemonke...
    - Twitter: / unitycodemonkey
    - Steam: store.steampow...

КОМЕНТАРІ • 165

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  2 роки тому +4

    💬 Learn how to change a Character Mesh Visual while keeping the same Controller and Animations.
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    🔴 RELATED VIDEOS 🔴
    Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) ua-cam.com/video/jXz5b_9z0Bc/v-deo.html
    FREE Characters and FREE Animations for your GAMES! (Mixamo) ua-cam.com/video/c4jtyDA7vcs/v-deo.html

  • @brettabraham
    @brettabraham 2 роки тому +6

    I've needed this so badly. Struggled real hard on how to do this for a while before just giving up. Great video!!!

  • @slygamer01
    @slygamer01 2 роки тому +23

    An alternative that avoids the object naming issue is to drag in the prefab, unpack it (right-click on prefab instance, Prefab -> Unpack) and then drag the objects straight from the unpacked prefab instance into your character object.

  • @ItsMeLuxel
    @ItsMeLuxel 2 роки тому +6

    Your Tutorials are so help full they have helped me out a lot

  • @maxcoleman42
    @maxcoleman42 2 роки тому +4

    Hey I just recently got into Unity, learning purely as a hobby at this point. Just wanted to say you make some great videos! Thank you very much!

  • @alsantour8835
    @alsantour8835 2 роки тому +8

    I wonder how many times in my life the Root (1) threw me off and I didn't even know why it wasn't working!

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

    I WAS JUST ASKING SOMEONE ABOUT THIS!
    Dang, coincidence or not, thank you so much for uploading this

  • @jean-michel.houbre
    @jean-michel.houbre 2 роки тому +3

    This summary of the points to check is very practical. Thank you !

  • @j.j.maverick9252
    @j.j.maverick9252 2 роки тому +1

    great video, thanks! I’ve had many problems previously and didn’t realise it is just three steps

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

    Super cool👍🏻
    Thank you for sharing this with the Community, I was wondering how to make this in an easy manner, and your video just came for the rescue 🙏🏻💥😆✌🏻

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

    Thank you for this tutorial! Just got som of synty's assets and this was super useful!

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

    Exactly when I needed them. You have perfect timing as always.

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

    I’ve been waiting for this tutorial!!!

  • @ivaniliev2272
    @ivaniliev2272 Рік тому +2

    ATTENTION as you drag your characters in the scene , unpack them with right click on prefab hierarchy(scene), and then unpack Prefab -> Unpack. This will allow to copy easily mesh and rig from your character to first person controller.

  • @ronaldinhodev
    @ronaldinhodev Місяць тому +1

    Obrigado Code Monkey! Não sabe o quanto me ajudou!
    Nosso projeto sairá do papel muito mais rápido agora 🤝👏

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

    Thanks :)

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

    Just when i needed lol!

  • @Vyken27
    @Vyken27 2 роки тому +2

    Thanks for the quality content you offer with your tutos ! Many of your videos are about FPS, so what about a tutorial of using Miror of how to set up a multiplayer network ?

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

      I plan to cover Multiplayer when Unity's MLAPI (NetCode for Game Objects) comes out of preview

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

    Congrats for your unity award
    Teacher

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

    great video! i noticed no one ever makes tutorials for serious/educational games (like typing games) that are any good. (Probably because theyre boring) but those would be a huge help for students! just a thought. thanks!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +2

      I enjoy some typing games like Typing of the Dead but yea it's a hard genre to make exciting on a UA-cam video

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

      Yeah I'm in my last semester and we have to make a super simple typing game. I've been able to do it but just barely. I find keeping my code organized when I have object pooling to be kind of difficult, but I'm also not really a programmer.
      I remember playing Typing of the Dead as a kid, that was fun.

  • @jeanlue
    @jeanlue 20 днів тому

    Thank you

  • @GamesAreArt1
    @GamesAreArt1 2 роки тому +13

    nice tutorial, I have some things i want to say:
    1.does this also work on characters with different size, the characters you use have identical size/scale will it work if i want
    to change from(Goblin to giant) characters with different size/scale.
    2.does such result can be done through Code example: my game character is a wizard that have the ability to transform to any creature in the game, can i do those steps by coding(i already done those kind of tasks but asking for more knowledge won't hurt).
    3. can we apply the SkinnedMeshRenderer Component Step to a MeshRenderer?
    thanks for your help i hope I'm not being anoying

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

      1. Size should not be an issue. - Best way to figure it out is by loading up Unity with some assets and playing around with it.
      2. Yes it can.
      3. Why/What are you trying to do?

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

      @@Veevslav1 I'm trying to know how far i can go with such feature in some older games i play a character can turn himself into a tower as a hiding skill idk but i think this is way different topic

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +7

      If the character is humanoid then yes the animations will work. However if the proportions are extreme then it might be a bit off.
      Sure, you instantiate the SkinnedMeshRenderer/Bones as a prefab and assign the Avatar through code
      SkinnedMeshRenderer is a different thing from a Mesh Renderer, you could apply the same Mesh and Material to a MeshRenderer but it would just be static non-animated.

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

      @@GamesAreArt1 For number 3 the character swap out is easy, as Code Monkey said, it would just be a static structure without animations or it would get a new set of animations along with a new skin if it is not humanoid and/or has a different skeletal system...
      So if you become a coat rack, you lose movement animation. If you become a cat you lose humanoid animations but could get cat animations. It is all about how much effort you are willing to put in to code something like this and configure it with in the game.
      Code is the great thing here. It paves the way to everything else.

  • @marekpuchon4878
    @marekpuchon4878 Рік тому +2

    Hi Jason this is really cool tutorial! Could you maybe make one, how to have separated invetory on those characters? Because when i swap them they are on one inventory. Iam really struggeling with that. Thank you

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

      This might not work since I haven't tried inventory systems before, but speaking from a programming mind:
      if you have your inventory as a separate class, you can just give each character an instance of this class.
      means you don't have to give them the inventory code, but rather make a new script for each of them and inside that script create a private member of the inventory class. This way each character will have it's own copy of the inventory and can call it's functions on it's own inventory.
      hope this makes any sense, also hope it works for you.

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

    Thanks! This will be very helpful. :)

  • @Gir_0
    @Gir_0 2 місяці тому

    It's a good overview.. but I'm still lost. Seems like if you're trying to do this with your own custom made character and rig there's a lot more involved. Thanks for getting the general concept across though.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 місяці тому

      As long as it's a humanoid rig it should be exactly the same. Make sure you set up the rig corectly in Blender and imported your model as humanoid

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

    If I have some procedural animation that need sto reference bones, they would loose reference when I change bones. Is there a way to keep references to the same bones in a humanoid avatar? Like a standard naming system that I can generate for any skeleton

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

    Thank you for the great Video!
    Could you please make a Video on how to do character creator and clothes for the character?

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

      That would depend on how you set up your character. Either enabling/disabling game objects if you have the clothes as separate. Or just changing a Material if the clothes are included in the same mesh.

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

    Great tutorial, as always!🇵🇹

  • @magnusgaming1360
    @magnusgaming1360 6 місяців тому

    THANK U MATE

  • @DevDunkStudio
    @DevDunkStudio 5 місяців тому

    If I do this with runtime animated models and then call Animator.Rebind, the scale of the imported model is still the same.
    Is there any workaround for that

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

    Mine mixamo rigged model doesn't have an avatar though

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

    Wow thankyou!

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

    Thank you!

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

    it keeps unpacking the prefab.. I use the nested prefab.. then all sort of problems.

  • @-Lola.
    @-Lola. 2 роки тому

    For some reason, when I click on the avatar of the new model I want to use I don’t get the option to configure it

  • @Jack-io5tk
    @Jack-io5tk 2 роки тому +2

    Great tutorial!
    I've been watching your content for a while now and was wondering if you had a tutorial for actually rigging the bones of a character? I've been trying to rig a character in blender for the past couple days but something with exporting it to unity doesn't link correctly. I've posted a few things on reddit on the unity and blender pages but no one seems to have any idea. If you could make a tutorial explaining a correct way to rig in blender or unity I would be eternally grateful.
    Unless you already have one then could you point me towards it.

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

      Nope sorry, I'm very much a beginner in Blender and I've never done any Rigging, not sure if there's any specific workflow to Unity, maybe you can import one of these characters into Blender and look how they're setup?

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

      Sebastian Lague has a good video on it here: ua-cam.com/video/jp_SqjB0468/v-deo.html
      It's part of a collaboration series he did with brackeys which covered all the RPG essentials, including sculpting your own character in blender

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

    i have a script i do this at runtime with, should that work too?, it doesnt

  • @Noizzed
    @Noizzed Місяць тому

    And if i want to have multiple models to swamp to? Isn't there a way to do it without having to rename the new object every time to the ones referenced in the bones?? So i can organize many models and just toggle them on and off when i need to

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +1

      For that you should just have different prefabs each with a different character setup

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

    This has been a awesome way to breath life into my prototypes, thanks so much! But I'm experiencing a weird bug. As I've been playing my games there has been a noticeable jump when my camera rotates and it gets worse the longer I play, to the point of jumping 90 degrees in one movement. Any thoughts would be appreciated friends!

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

      Is it really the camera or just your game freezing for a moment?
      Camera movement is using deltaTime so if the game freezes for a bit then the camera will "jump" a lot in the next frame. Look in the profiler, maybe you're spending too long on garbage collection

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

    Excellent tutorial as always. Question I have is- is anyone else synty character going thru objects? I'm using the apocalypse assets v1.09.

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

      The assets are just visuals, they are completely separate from physics, so that depends on how you handle your character controller and your world colliders.

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

      ​@@CodeMonkeyUnity meaning I will have to add to add colliders to the Synty sets right? lol Thank you so much for your reply and help

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

    What if you want to swap characters but select all? So swap primary in otherwords for a style like baldurs gate or Kenshi etc.

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

    Perfect!!!!

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

    I've tried to change for a skin from Mixamo ... but the mesh is showed flying, and I don't find an explaination for this behavior ...

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

    How would you make a skin selection system?

  • @user-iv5yq9vj8t
    @user-iv5yq9vj8t Рік тому

    if you will try to script it.. it's won't gonna work at ther runitime

  • @elektroskeptic481
    @elektroskeptic481 28 днів тому

    I imported an FBX of a character, but there are no AVATARS to assign. What are those avatars?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  28 днів тому +1

      On the import settings in Unity you can select "Create Avatar from Mesh"

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

    Hi Code Monkey Could please do a character selection video i.e for one scene to other i am currently stuck doing it for the third person controller cause not able to dynamically change the Avatar any help would be appreciated .
    Please Help !!!

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

    How could I make my 3D model with a kind of cutscene? Like a transformation, like super saiyan, without a menu.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +2

      Mesh morphing? Look into Blend Shapes
      But in most cases things like that are actually just regular mesh changes hidden behind effects

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

      @@CodeMonkeyUnity Thank you

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

    Hi, could you maybe make a tutorial on The GraphTools Foundation Package?

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

      That's interesting, I wasn't aware of that package, seems like the last update was a year ago though.

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

    How could I make the models change automatically? I want to make my character go around changing "frames" at the right times, it's composed of voxels (It's like pixels, but it's 3D).

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

    Would this work with the Synty Mech pack they just released. Specifically the Mechs, not the pilots.

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

      I haven't tried that pack myself yet but assuming they have humanoid rigs yes this should work
      For customization I covered that topic in more detail in this video unitycodemonkey.com/video.php?v=nSmEirb8JGM

  • @banzyo-Jesda
    @banzyo-Jesda Рік тому

    What about to update old unity3d file to the new version ?

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

      Updating to new versions just means opening the project in the new version. You just can't go backwards

  • @AimedX3
    @AimedX3 Місяць тому

    i have a pack that does not have a character avatar, is it still possible to do it? because i tried but and wont work, so i was wondering if there is a workaround

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому

      On the Import settings you should be able to have Unity auto-generate the avatar (assuming it's a humanoid mesh)

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

    What i was looking for was how to transform my charcter into a beast form? will i need a beast form mesh and retarget it or is there a way to automate anthromorphic transformations as well?

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

      Sounds like you need to look into Blend Shapes, it's a topic I haven't researched so not too familiar with it.

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

    Has anyone else noticed that sometimes when you import character from mixamo the left foot is twisted?

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

      I have noticed that some characters/animations do have some strange issues with the feet, one solution is to duplicate the animation in order to make it editable and change it, or go into the Avatar and change the range of motion

  • @chrisquain1362
    @chrisquain1362 8 місяців тому

    Do you need to rename all the bones on the new model to have the animations work?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  8 місяців тому

      No, the bones are assigned in the Avatar in the mesh import settings, as long as you're using a Humanoid mesh with a Humanoid avatar they will load correctly

  • @HoisinDuckWrap
    @HoisinDuckWrap 9 місяців тому

    Hi Code Monkey! I was changing my character's look, and now when I hit play it animates, but the mesh is really skinny or something, like I can see some dots and lines in the play mode, but the model isnt filled out, do you know why this is?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  9 місяців тому

      Sounds like something in either your Animation or your Rig is broken. Try a different animation or a different character

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

    my question is: How do you use this with animation rigging

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

      Not sure what you mean, Animation rigging works on top of a skeletal mesh, regardless of where that mesh came from

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

      @@CodeMonkeyUnity yes you're right. I finally got it to work. My problem was that I had the entire model FBX imported under a player object that had an animator and many other scripts running on it. But after watching your video more carefully, I was able to place the skeleton and mesh renderer directly under the player object, allowing animation rigging to work. Thanks for your response🙏

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

    Thanks for this great video. does this by chance work for changing out characters that are updated to have blendshapes? I have a situation where I have a new FBX with facial blendshapes and I want to swap them into another prefab already using the same model without blendshapes.

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

      I've never used blendshapes but doesn't it use a SkinnedMeshRenderer? If so then everything should work the same

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

    what if i have ragdoll on my bones ? can i do it this way ?

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

      Usually you want either Animator or Ragdoll and not both at the same time. So yes you could have a ragdoll, just make it all disabled/kinematic while the animator is moving it

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

    I have a ragdoll on my skeleton. Should i recreate the whole ragdoll process?

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

      Yes you would need a different ragdoll for different skeletons

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

      @@CodeMonkeyUnity Isn't it possible to only change the skin?

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

      ​@@fabianobersovszky6987 You can just change the skin if that skin was made for that skeleton. But if you want to use a different skin that requires a different skeleotn then that new skeleton needs a different ragdoll setup

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

    Thanks for the tutorial, just starting to learn the details about the animation system and it can be hard to find a current tutorial for how to do relatively simple tasks at times.
    Speaking of, I have a pack of animations and when attempting to use them with a model it *works* but the animations look off because the new character is wearing armor and the arms intersect the body. Is there a simple way to adjust this when importing the animation/model/rig or do you need to edit the animations to fit the thicker model in an external program?

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

      You can go into the Avatar of your mesh and add limits to the bones. That might fix it or it might be easier to fix the animation itself.

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

    is this the mecanim humanoid retargetting system or is this different

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

    Nice

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

    Thank you so much for this video.
    If i may ask..
    How did you switch characters inside game mode...?
    Regards..

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

      You would do all these steps through code instead of manually in the editor

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

      @@CodeMonkeyUnity
      Thank you so much for the answer..
      Maybe one day we can see how to create that script 😉.
      Regards..p.s
      I.m making tpp rpg project where you can play with 2 characters all the time, that's why i.m looking for that script.

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

    i need help, my character is a half trough the floor
    i dont ñnow why is this happening

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

      Check where you positioned the collider and the character visual, maybe you just added a collider at chest height

    • @reessoft9416
      @reessoft9416 9 місяців тому

      You've probably sorted it now, but that sometimes happens when you get an animation from somewhere, and the animation isn't set to humanoid.
      Go to the animation, and set it to humanoid, as you would for a character.
      Make sure your character is also set to humanoid, on the "rig" tab.

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

    Hey! How would I go about changing the default animations though? :o
    I try to move the armature around (after duplicating the read-only animation) but it just rips off his parts. lol

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

      What default animations? The Unity Starter project animations?
      And what you mean by changing? Modifying the animation itself? You can do that either in Blender or inside Unity with some assets unitycodemonkey.com/video.php?v=bZW2IEmwOEg

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

    Can I do like that for Generic (not use Humanoid)?

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

      The character needs to be Humanoid if you want to retarget Humanoid animations

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

    Thank you for this video, I managed to fix the TPose issue I was having. I do have a question regarding the thirdperson asset setup. I have a script that is a do not destroy on load from the previous scene, which is the character creator. My main problem is that when I play the game normally the player movement is 100%, but if I am enabling the players GameObject that has the skinned mesh renderer based on the users selection from the script that get's populated with either player prefs if they exist or from the selection. The Camera bugs out and clips the character when walking backwards, and only backwards. I am not sure how to combat this. The script basically checks which gameobjects should be enabled based on gender, attachements (hats, glasses, etc) which will be used for loading and saving games as well. I use for loops to enable and disable what should be on Awake on the game scene. With doing this, the backwards is well not functioning correctly, when I move the mouse the camera jumps to the correct Follow Distance again. Any thoughts on what I must look at? Or why the enabling of a skinned mesh gameobject could cause this odd bug?

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

      Setting one gameobject on, and altering the code to switch it off and then select the players set option to active seemed to have worked... still on odd bug though.

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

    I just realised what day it is and I'm being wary...

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

    how would you do this with a rigidbody I cant find any info on this lol

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

      Not sure what you mean, the way you control the character has nothing to do with the visual. You can use a Rigidbody or a moving Transform or a Character Controller or anything, the Animator/SkinnedMeshRenderer is completely separate from that.

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

      @@CodeMonkeyUnity I mean for example if you create a script for a rigidbody. Give it movement and clamped mouse so its an fps style and include a mesh so its not a basic capsule. That part is easy. But there isnt really any videos or documentation about animating the mesh on a rigidbody. I made a blend tree and have spent from noon today until 6:20 pm trying everything reading searching youtube and google. Just to try and find a way to have the blend tree play the animations on movement. With a character controller there is a vast amount of information but when its just a rigidbody there is almost nothing have a look for yourself. Would love to see some example vids on that. For now I think I have to give up on the rigidbody and go with a character controller. Wasted two days :(

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

    VICTORY AT LAST! An Important point is unpacking the prefabs.. duh. Had to slow down the video and take screen shots of what you were doing.. so I could enlarge, and see the EXACT files that you duplicated, and the EXACT files you replaced. SO SIMPLE! But remember, we are students.

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

      What do you mean? What part were you doing wrong? Did you duplicate the files like I did in the video? If you do then you don't need to unpack the prefabs since the duplicates will not be part of a prefab

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

      @@CodeMonkeyUnity I had to unpack the prefab on the UNITY model. Plus I was copying the wrong files. I get it now. thanks.

  • @biocronic2986
    @biocronic2986 4 місяці тому

    its not working with other characters than your example

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 місяці тому

      What do you mean? What exactly isn't wokring?

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

    How do I handle a downloaded character with an extra "Armature" in the Skeleton hierarchy? I tried renaming either the hips or the Armature names, and I tried moving the Hips up the hierarchy and changed that name.

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

      What do you mean extra armature? It has two skeletons inside it? That's odd, it should only have one
      Renaming things usually doesn't work, it needs to be exactly like it was when the mesh was created

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

      @@CodeMonkeyUnity Thanks! I worded that badly, but I have it fixed now. I saw my mistake after watching again.
      I had an amature on a character that had a hierarchy like the Unity character (Armature -> Root -> Rest of bones). So I had to fix the name of the Armature ("Armature (1)" to "Armature") and then drag the Root (Hips) to the Root Bone in the Skinned Mesh Renderer. I kept only doing one of those.

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

    How do you do the same for 2d?

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

      Depends on what type of 2D character are you using. 2D Spritesheet animation? Or 2D Skeletal?

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

      ​@@CodeMonkeyUnity Skeletal. I imported a psd and created the bones and IKs. The first prefab is fine, but when I copied and changed the sprites, I can no longer edit the weights of the structure. Maybe I should just put together another psd? What if I want to add say a different t-shirt for each character in the future. I will have to include more layers which will be the same for each psd, since I the set of shirts will be the same. This would be quite repetitive and I was hoping to avoid it. Any ideas?

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

    Edit: solved in reply
    Hey CM,
    I'm able to get my custom character to animate fine inside the editor, but as soon as I export a build my character stops animating and stays on frame 0 of idle.
    Any idea what could be causing this?
    Thanks for all the videos and courses, they're extremely helpful.

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

      Someone helped me solve this on discord. I had an extra animator on my custom character as well as the parent object. Removing the extra one fixed it.

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

    Wouldn't it be simpler to just add the animator to your character and putting that as a child of the object that holds the scripts

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

      Depends on how your object is set up, if you have nothing but the Animator in that game object then yes swapping that would work. But if you have extra scripts in that game object then its easier to swap the contents instead

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

    Hi there ,I have doubt in the scene manager.for example ,I have two scenes ,if I use the code (Scenemanager.LoadScene(Scenemanager.Getactivescene().buildIndex);
    //When die the current scene loads
    My doubt is that if I die in scene 1 or scene 2,will I reload in that scene.

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

      Like if I was in scene 1 ,it loads in 1,if it is scene 2 ,it loads in 2

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

      Yes it seems like that will reload the current scene, just try it

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

      Ok sorry I didn't see this .thank you so much

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

    What packages do I need to get from

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

      Get what? The assets? There's links in the description for the video where I covered the Starter Assets, Mixamo and link to the Synty City pack
      ua-cam.com/video/jXz5b_9z0Bc/v-deo.html
      ua-cam.com/video/c4jtyDA7vcs/v-deo.html

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

    Thanks code monkey

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

    this is the issue that made me quit 3D, I'll give it another go

  • @harharrr9810
    @harharrr9810 3 місяці тому

    not working :(

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

    Can we make ai like call of duty in unity

  • @PANDA-wz8fz
    @PANDA-wz8fz 3 місяці тому

    Is there an UE 5 tutorial would be nice 😢

    • @WolfServant
      @WolfServant 3 місяці тому

      Bro... switch to unity then you won't have to be missing good tutorials.

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

    How about 2D games?

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

      If your 2D game uses a 3D mesh then its the same way. If it's a sprite without any bones then you just change the sprite

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

      @@CodeMonkeyUnity thank you code monkey

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

    4th

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

    This. Is. So. Not. Useful.
    (HAPPY APRIL FOOLS 🤣)

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

    you speak so fast

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

      Really? I normally watch my own videos (and others) at 2x speed

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

      @@abdoulraoufgambo As long as they are in front of the camera they will render. If you make a camera orthographic (2D) it still renders any 3D mesh that is in front of it

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

      @@CodeMonkeyUnity thank you very much

  • @concernedcitizen9101
    @concernedcitizen9101 7 місяців тому

    terrible tutorial. Dont confuse people with what not to do in the middle of showing what to do.