How to do a BACKSTAB Mechanic! (Learn Vector3.Dot, Elden Ring, Dark Souls | Unity Tutorial)

Поділитися
Вставка
  • Опубліковано 20 сер 2024
  • 🎮 Get AWESOME Synty Assets 50-70% OFF! cmonkey.co/syn...
    🔴 Souls-like Essential Animations assetstore.uni...
    👇 Click on Show More
    🌍 Get my Complete Courses! ✅ unitycodemonke...
    👍 Learn to make awesome games step-by-step from start to finish.
    🎮 Get my Steam Games unitycodemonke...
    🔴 RELATED VIDEOS 🔴
    Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) • Kickstart your game wi...
    SMOOTH with LERP! (Move, Rotate, Float) • SMOOTH with LERP! (Mov...
    Game Dev REACTS to Elden Ring! • Game Dev REACTS to Eld...
    Melee Combat System in Unity 2D (With Targeting!) • Melee Combat System in...
    3 Ways to Find Targets in Unity! (Collider, Physics, Distance) • 3 Ways to Find Targets...
    💬 A while ago I made a poll asking for any Elden Ring related mechanics that I could remake.
    I played the game and a great mechanic that is relatively easy to do is a Backstab.
    This involves using the Vector3 Dot product, you can use it to identify if behind an enemy.
    And it also involves matching a Attacker animation with a Victim animation, matching the position, rotation to make the BACKSTAB really impactful!
    📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
    🌍 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...

КОМЕНТАРІ • 138

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

    🎮 Get AWESOME Synty Assets 50-70% OFF! syntystore.com/o/codemonkey
    🔴 Souls-like Essential Animations assetstore.unity.com/packages/3d/animations/souls-like-essential-animations-178889?aid=1101l96nj&pubref=eldenRingBackstab
    🌍 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
    SMOOTH with LERP! (Move, Rotate, Float) ua-cam.com/users/shortsjAN2IoWdPzM
    Game Dev REACTS to Elden Ring! ua-cam.com/video/-xqroyuoi7g/v-deo.html

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

      @Trevorpool Yes the video is a very simple demo just demonstrating backstab logic and nothing else, there's no health system on the enemy, no find target logic, not hit detection logic, etc

  • @swordy70
    @swordy70 2 роки тому +41

    Ohhhh boy!! I'm making a game that should have stealth in it and i was making a lot of tests and i finally got a way to sync the animations together!! And now you just dropped this video and the same things you did to the backstab can be applied to stealth but with some edits. And now i can combine my way and your way and make the perfect stealth system!! Thank you for this great video dude :D

  • @ragerungames
    @ragerungames 2 роки тому +18

    best ever moment for unity developers when actually codemonkey started game dev in 3D :D
    Hoping to see a 3d game from you on steam someday.
    Hoping to see you soon on Jason Weimenn live shows... Last week or 2 weeks before, he said it will be great if CodeMonkey can join.

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

    A parry mechanic would be really nice to see. Great video as always!!

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

    As a small nitpick which doesnt really change the video itself:
    If you are behind someone and attack it triggers a "Attempt backstab" animation (ocourse only if the target is backstab-able). If the hitbox of the weapon hits the target, doesnt matter where as long as the target gets hit by the "Attempt backstab animation"(which only triggers if you are behind someone), only then the backstab animation like in your video plays.
    If its PvP, then the "Attempt backstab" animation also needs to hit the enemy's back, otherwise it wont suceed.
    There is a great video about it called "Why Elden Ring changed backstabs - A history of the Soulsborne backstab"

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

      Very interesting video! Thanks for the link!

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

    Since you covered this, You should do a tutorial on melee combat and melee executions with the starter assets!

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

      this ive been waiting on that for a long time

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

    This one was pretty easy. Would love to see no loading screens mechanics. Like Bloodborne for example. You can progress through the whole game without ever seeing loading screen.

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

      That's something that I would really like to see

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

      just async load multiple scenes, all you need is to have a trigger collider in different zones to load/unload scenes that are close/far enough

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

      @@zerogamedev I know how this works mate. Just want to see our friend's code monkey approach on this. In the end there is more than one way to skin a 🐒.

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

    I remember the reason why I started making my own game. If you can't buy the game, make the game. If there's no game that you like, do it yourself.
    This kinda feels like it, if you can't play Elden Ring, then do it yourself where you can play it. I do have portable consoles but there's still a game I'd like to see but rarely everyone do today.

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

    These are the type of tutorials I absolutely adore, where you show how to put to remake actual features from other games! Great as always Mr.CodeMonkey! :)

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

    Ohhh sweet. I already have one in place in my project but I'm always down to see how others do it. It's always interesting to see.

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

    This could not come at a better time, I need this for a game of mine. Thank you!

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

    Great video,
    never played Elden Ring
    but I always love to learn something new in Unity.
    I mostly worked in 2D only,
    just getting started in 3D
    and your Tutorials are amazing for that.
    Also great idea to use the Synty Assets
    as they have been on sale or in a bundle a lot lately.
    The Fantasy Kingdom Set is currently on sale for -70%

  • @Rahulsingh-theraha
    @Rahulsingh-theraha 2 роки тому +2

    It is really great to see u r now doing 3d tutorial for a while🙂

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

      My main issue with 3D was always lack of assets but since I've bought so many over the past years now I have enough assets for pretty much any prototype I want to make!

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

    Awesome tutorial ... I like that you back to this kind of videos as well. Keep it up!!

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

    Definitely going to apply this feature to my game. ☺️ Riposte and stagger as well.

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

    Can't wait to see you post some Dark Souls-like dev tutorials!!!

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

    Amazing video as always. I wish we get a climbing system in the future even if it's a basic one.

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

    There is a match frame method on an AnimationController. I used it to mach end of movement at exact position

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

    I am making like a dark souls type game (I would not say a clone) and this helps keep up the good work!

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

    The plunging attack !!!

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

    Thank you so much for these! I stopped doing game dev about 10 years ago (C# and XNA, also C++ and DirectX/OpenGl) and wanted to get back into it using Unity... I hated programming HLSL. Most of my experience with Unity is making tech demos... although I got really good at integrating Unity with Twitch and building a Twitch bot in Unity (still trying to figure out UA-cam integration). I just got all of your courses a few weeks ago and I'm really looking forward to your XCOM remake course.
    The one question I have is how would you handle mod support in Unity. I have a good idea on how to implement 3D/2D assets and stats... have Unity dynamically load files from a resources folder with a model and an associated text file (for stats). But how would you allow modders to upload custom scripts (that change how the core game functions) for Unity to use? Would you use something like LUA or does Unity have it's own implementation?
    The other things that I'm interested in is how to program a multiplayer game (in XNA it wasn't as straight forward), how to setup and host a stats server (ie leaderboards, daily challenges), developing over multiple OS, how you do your debugging/testing, and how to publish to steam.
    Once again thanks!

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

      Yup for stats you really just do File.ReadAllText on the Application.dataPath, could be a basic .txt file or some JSON
      Same thing for loading images, just load the bytes and load the Texture into Unity ua-cam.com/video/Gk0-amfn5DM/v-deo.html
      For custom scripting, that's actually something I've never done and I'd love to research, LUA would indeed be a good approach, I don't think there's any built-in Unity tool.
      There's also a C# Runtime Compiler that I picked up a while ago, looks interesting but haven't tried it yet assetstore.unity.com/packages/tools/integration/roslyn-c-runtime-compiler-142753?aid=1101l96nj
      For multiplayer, Unity's official tech called Netcode for Game Objects is currently in preview, when it's out I'll definitely be doing some tutorials on it docs-multiplayer.unity3d.com/
      Best of luck in your learning journey!

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

      @@CodeMonkeyUnity I recall Unity themselves doing a poll about mod support while back and I think it went through, meaning we might see a official mod support in few years.

  • @Jamie.Carmichael
    @Jamie.Carmichael 2 роки тому +2

    If your interested in the math behind Dot products Freya Holmér did a great video explaining it.

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

    This video is on a whole other level!

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

    Wow really cool dude !!! .. was this for mee ? yesss meeeee !!!

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

      Are you implementing a backstab in your game? I hope the video helped!

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

    wow awesome! I was thinking to just get the state of the enemy (stunned) and then do the backstab when conditions are met but this is a whole package when it comes to checking distance and positioning of the characters! Thanks mastah! ^^

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

    No Wonder my teacher said, as a game designer, we have to be good at math XD. Thanks for your video

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

    Great stuff!

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

    Love it!

  • @benjaminswee-shaders
    @benjaminswee-shaders 2 роки тому

    Great design! Also a cleaning looking game and particles.

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

    A series for making cool mechanics from dark souls like would be cool.

  • @AkshayGupta-dd4ht
    @AkshayGupta-dd4ht 2 роки тому

    I need this .. thanks

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

    I love you man

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

    I haven't watched video yet, but I bet there's gonna be a dot product somewhere.

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

    2nd 🙂Very nice math tut .. i 1st time seeing math in action 😂

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

      heh yup, math becomes much easier to understand if you see it in action

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

    This is the next level tutorial, very cool video ...can't wait a video on how to make enemy take damage on head shot

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

    Awesome video, always wondered how to do it

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

    I love your Videos, and i got one of your Courses, i didn't started yet, but it looks very goog

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

      I hope you like it! Feel free to ask any questions in the Q&A section, I answer all of those every day

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

    Great tutorial!

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

    Thank you so much for that!! Can you also make a video about parrying with a shield or another sword?

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

    parry mechanics would be interesting to learn

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

    I'm going to reiterate my request for a Snake Pass kind of movement. I;ve never seen it done by any of the gamedev YTer. Mark Brown has a video on the generalities but no one has the specifics

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

      I need to find the time to play it first, I do remember watching that GMTK video but don't remember how the snake moves.
      It think you just move it left/right/up/down which applies some rotation to the forward vector while also moving the snake forward.

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

      @@CodeMonkeyUnity iirc, the controls are for the head to point left, right, up, or down and there's a separate control for just forward which moves only the head in the direction it's facing then pulls the rest of the body behind. I've never played it myself but I think the description in the GMTK video is enough. I did try to make a similar movement in Unity but alas could not figure it out.

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

    you should do bloodstains from elden ring

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

    Do you have a tutorial for target selecting? Since, in this tutorial we are hard coding in the enemy reference

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

      I covered several methods here unitycodemonkey.com/video.php?v=h9oEhVqGptU

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

    normal getting hit animation is playing every time while attacking even if the enemy is way far

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

      Yup in a proper game you would add some logic for actual hit detection

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

    after I hung a navmesh on the enemy, the script no longer works how to fix it

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

    What are the up- and downsides of using this dot-Product method instead of using box triggers behind enemies?

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

      This is much more simple and much more performant, adding extra game objects and extra physics colliders has a certain cost and if you add them to every single enemy then that cost can really add up

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

    nice

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

    great work thnx

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

    Alright who's ready to find the spy. Right behand you.

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

    Remember to balance it well, nobody wants chan backstabs back

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

    Good

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

    In a nutshell
    1. Add backstab animation asset
    2. if (behind) do animation
    Do Inner Product to know whether behind or not

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

      Yup it's pretty simple! The tricky part is knowing about how Vector3.Dot works

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

    Please do an RPG 3d series 🙏🙏

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

    very cool

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

    How do you do this with multiple enemies? As how do you recognize which one you are attacking in order to get its position?

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

      You could use the direction of the camera to identify which one you should target, I made a nice targeting system for a melee video a long time ago and that same logic could be used here ua-cam.com/video/AXkaqW3E9OI/v-deo.html
      Or other methods for finding a target ua-cam.com/video/h9oEhVqGptU/v-deo.html

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

    Hi Code Monkey, could you do word connect word board generation randomly ? it would be great, i tried a lot of and my code so far but still it doesnt work very well or can you give me any idea for this generation
    Love from italy

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

      Like a word puzzle where the letters connect? I'm not sure if there's a specific algorithm for that type of generation but brute force might work, pick a random word, then go through the letters and find more random words that start with those letters or have them in the middle and so on. It's not pretty but brute force should work.

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

      @@CodeMonkeyUnity It just works between two words, i tried it with this method, its really hard man :)

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

    Codemonkey, I got a problem and not many youtubers actually provide solutions. How do I make footstep sounds with a blendtree? Animation events don't work in this case. Awesome video about the elden ring by the way

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

      Animation events do work but only one of the active animations will play them. I can't remember if it's the first one that starts animating or the one most active.
      When I had that problem I just added Animation Events to all the animations on the blend tree
      If that absolutely does not work, you can get the Foot bone position and do a raycast to see when it hits the floor

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

      @@CodeMonkeyUnity Thanks!

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

    Absolutely love the video!!
    I have a question, sometimes my backstab doesn't position itself correctly when my enemy is chasing me. I am stopping the movement as well before doing anything as well. Any ideas why this is happening? thank you :)

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

      Hard to tell why because chances are it's related to whatever character controller or animation system you're using. Is the position wrong or just the rotation? Does the animation have root motion? You probably have another script conflicting with the backstab script and you end up with 2 scripts moving the same object

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

      @@CodeMonkeyUnity Got it, So it turns out when you are using a character controller you must disable it before setting it's gameObjects transform. This is due to the fact that the character controller is constantly setting the position of the gameObject. Thanks heaps!
      How did you get the player to face the direction of rotation when he gets back up? When I transition back to idle it rotates my character?
      Also do you have a discord?

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

    Awesome tutorial, thank you!
    Can you show us how you setup the animator and transitions, or do you have a tutorial somewhere on it? I am using the third person asset(that tutorial was great also!!)🙂I have the melee working OK, but the transitions are kind of wonky. I have watched your "New Input System" video and it was great, I didnt even realize they had a new input system! lol Thanks so much!

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

      It's just a trigger transition to go into attack/backstab state and then automatically back into idle/walk when that state is over. I don't have a UA-cam video just on that topic but I do cover the animator and animator parameters in my ultimate unity overview course

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

    Great video! Would it be possible to make a tutorial on infinite (or very large) pooled inventories using scroll rect? I've managed to create an inventory and such, but when it gets very large (200+ items), it causes massive performance issues (understandably). I haven't been able to get one working because I'm a complete dumbass.

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

    What would you do, if you have multiple enemies? Now you have set the one enemy per drag and drop but if you have 3 enemies, how would you habdle it?

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

      You would have some kind of find target logic to find which target it should attack ua-cam.com/video/h9oEhVqGptU/v-deo.html
      ua-cam.com/video/AXkaqW3E9OI/v-deo.html

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

      @@CodeMonkeyUnity thank you. This really helped

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

    I feel that most of our videos are transitioning to 3D now is it?! and i do wonder, will this work while walking?

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

      As long as I can find assets then 3D is great!
      In a more complex example the player would have some sort of state machine that would disable moving while the backstab animation is playing

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

      @@CodeMonkeyUnity oh id love to try this out in a sample scene like a dark souls type game

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

    im still learning but a quick question. In a full game dev setting wouldnt it be better to give a pc or npc a defined front and back say with their character controller placed on the target. that way rather than getting the vector 3 ref you are getting the predefined based on position direction the target is facing. im still training my thoughts when im am learning programming and game dev to think about how to make the code over all modular.

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

      You could but you would add unnecessary colliders. If the goal is exactly this, just knowing when something is in front or behind, then simple math is better than colliders.

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

      @@CodeMonkeyUnity ahh so code is better here. Thank you. Would that also mean making a back and front with code for all npcs is better?

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

      @@dayanson6920 This logic works with anything, doesn't matter if it's an NPC or Player or an inanimate object, it just looks at a transform forward vector. So there's no need to add colliders to all the various objects you want to have this logic

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

    Hello ! Could you also help us to make a mêlée controller ? Like you did for the TPS tutorial ? It would really help us to fit this backstab with a Real controller 😇

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

      Yup I definitely want to do that!

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

      @@CodeMonkeyUnity you became literally the tutorial God about unity 🥰

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

    I can't find thirdPersonController.setTargetRotation

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

      It's not a built in function, I added that for this demo, it just rotates the object smoothly towards a certain target rotation. The smoothness is with Lerp unitycodemonkey.com/video.php?v=jAN2IoWdPzM

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

      @@CodeMonkeyUnity thanks for answering , I appreciate it

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

    How did you do the blood effect and whatnot, the impact is really cool, would love to see a vid!

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

      It's a particle effect from the Polygon Particle pack, it just gets instantiated when the Animation Event triggers

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

      @@CodeMonkeyUnity Aaah, I see. Would still be interesting to see how to put something like that together in a tutorial though !

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

    Would having some sort of trigger behind the enemy work as well?

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

      Sure, you could make the logic hitbox-based instead of math-based. Possibly combining with an attempt backstab animation, test if the sword hitbox touches the back hitbox and if so do the backstab

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

    Wouldn't it have been better to move the player to behind the enemy?
    As in if we sneak up on the enemy, why would they step back into a back stab, the player should step forward instead

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

      Usually the player has more complex logic than the enemy, so moving hte enemy could be simpler

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

      @@CodeMonkeyUnity kinda lazy, and it doesn't look good

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

      @@SaadTheGlad Whichever one you move will look the same. In order to make the animations match one of them must move.

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

    hi~awesome tutorial!how can i get the source code?

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

      I didn't make a package for this one since in terms of code everything is simple, all the backstab code is shown in the video

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

      @@CodeMonkeyUnity no you didnot what about the function of rotatetofacecameraforward function in playerbackstab script

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

    You associate backstab with Elden Ring, i associate backstab with spy from TF2, we are not the same

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

    Please link to source code

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

      I didn't make a package for this one because all the code is shown in the video so there's no need. It's really just the Vector3.Dot and Vector3.Distance

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

    Well better make to move player not enemy with animation, bc it looks just bad! That sliding.

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

      Either way one of them will be sliding, you could increase the speed to disguise it or limit the max backstab distance

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

    Which application is this

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

      This is Unity ua-cam.com/video/E6A4WvsDeLE/v-deo.html

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

    First

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

    Eh, you kinda gloss over the details that go into the how the code works

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

      How so? All the backstab code is written in the video.
      What part would you like to know more about? The character controller? It's from the Unity Starter Assets ua-cam.com/video/jXz5b_9z0Bc/v-deo.html

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

      @@CodeMonkeyUnity mostly the fact that player has a reference to the enemy
      Not realistic

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

      @@juicedup14 I covered find target logic here ua-cam.com/video/h9oEhVqGptU/v-deo.html

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

    4th

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

    spt tf2

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

    eww...elden ring there only for hype. er uses same parry/backstab as des and ds 1,2,3

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

    Good

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

    Good