Copy Animation State in Unity Tutorial

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

КОМЕНТАРІ • 25

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

    I used your tutorial for something else (changing my character's skins), I seriously spent months looking for how I could implement it and your code helped me a lot.

  • @IljaDidDevs2
    @IljaDidDevs2 3 роки тому +3

    Awesome content! Definitely interested to see how you achieved that shader effect as well :)

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

      Thanks! I’ll try and make one about the shader, maybe show a few variations like for crystals and such

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

      @@PabloMakes Nice, sounds interesting!

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

    Great tutorial with simple explanation. Best part of the video is that instead of just showing how to do it, you introduced pooling (which is important if not using ECS) for performance sake.
    The trick on Dahlia looks similar to TeriTeri evade from Honkai 3rd. BTW, Karina and all the fluffy grumpy cats are so cute!! Personally I would choose to use custom toon shader for anime style characters, but you tune the lighting to make them look nice also.
    Thanks for sharing! Hope you keep on making videos! Muchas Gracias!

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

    awwww , from the title, i thought you were going to make this via shader graph... lol
    but i like it anyway~~ cheers~

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

    Outstanding! Struggling getting the 2nd script "GhostController" to work as the camera never shows the top portion of the script. Any chance you could provide a copy?

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

      I show the top part at 9:12 I think you can see everything there except for the using statements, which im sure are pretty straight forward, but if you are still stuck, let me know the error you are getting and I'll try to help

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

      ​@@PabloMakes thank you for the reply. I was getting errors on pretty much every other word. I'll check again at 9:12 and see what I can figure out.

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

      @@PabloMakes I've still got errors throughout the code (no errors in the CopyDemBones script) There are a few sections I still can't see on the video. The first error is with: List Ghosts; - (unknown symbol error) .. and then pretty much everything after GenerateGhost(); in the update method is red. I'd really appreciate a copy of the script. See below for what I've got so far I've also noted the 2 places I still can't see from the video (Start and the code above private void GenerateGhost() )
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class GhostController : MonoBehaviour
      {
      public GameObject SourceBoneRoot;
      public CopyDemBones GhostPrefab;
      public float GhostDistance = 10;
      public float GhostLife = 10;
      public float GhostFadeInTime = 1;
      public float GhostFadeOutTime = 1;
      public float GhostDistortion = 1f;
      public float GhostDistortionOutTime = 1;
      public float GhostScaleOut = .25f;
      bool Generate = true;
      Vector3 LastPosition;
      float DistanceTraveled = 0;
      List Ghosts;
      Vector3 InitialScale;
      Queue GhostPool;
      public bool GetGenerate()
      {
      return Generate;
      }
      public void SetGenerate(bool value)
      {
      Generate = value;
      }
      void Start()
      {
      //CAN'T SEE CODE
      }
      // Update is called once per frame
      void Update()
      {
      DistanceTraveled += Vector3.Distance(transform.position, LastPosition);
      LastPosition = transform.position;
      if(Generate && DistanceTraveled >= GhostDistance)
      {
      DistanceTraveled = 0;
      GenerateGhost();
      }
      }
      List removeGhosts = new List();
      foreach(GhostContainer ghost in Ghosts)
      {
      ghost.Life -= Time.deltaTime;
      if(ghost.Life 0)
      {
      ghost = GhostPool.Dequeue();
      SetGhostMaterialVar("vertexDistortionStrengh", ghost, 0);
      ghost.transform.localscale = InitialScale;
      ghost.gameObject.SetActive(true);0
      }
      else
      {
      ghost = Instantiate(GhostPrefab, transform.parent);
      }
      Ghosts.Add(new GhostContainer(ghost, GhostLife));
      ghost.transform.localPosition = transform.localPosition;
      ghost.transform.localRotation = transform.localRotation;
      ghost.Source = SourceBoneRoot;
      ghost.Initialize();
      ghost.CopyBones();
      }
      }

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

      In start you probably need to initialize the ghost queue. It’s hard to read with this formatting but it looks like you closed update and then wrote code outside of a function? Might just be the formatting tricking me

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

      Hi Frosty did you ever get your copy animation to work?

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

    Great tutorial Pablo, thanks for sharing the wisdom! Although I'm wondering how much of a performance hit enabling/disabling objects in the hierarchy is, maybe in certain cases pooling isn't worth the performance gain. I'm also curious whether the pooling approach is too taxing on the memory or not. For example do inactive objects in the hierarchy take up as much memory as the active objects?

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

      Glad you enjoyed it! Memory wise they totally take as much memory but in practice the big memory consumption comes from assets, you are not likely to go OOM from game objects so I would not worry too much there.
      I think a circumstance where a pool is questionable is when the number of objects being used varies wildly, like let’s say you have mini map markers, and when you go into a town there’s 30 different markers for vendors but when you go out into the world you only have 1 marker for your objective. Using a pool there you would have 29 markers allocated that essentially do nothing.

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

      @@PabloMakes Thanks for the insight! That cleared up a lot of the questions in my head regarding the topic.

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

    Great video! It would be really cool if you could make a video about the shader of distort appearance.

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

      Glad you enjoyed it. I’ll plan a video for that, lots of cool stuff can be done with that

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

    nice video ty

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

    Nice video! Well explained and I love this tips of old school developer ;)
    I like this shader. If you can make this tutorial I will apprecite it, sure i lean lot of things ;)

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

      Looks like a few people are interested so I’ll make it happen!

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

    great tutorial 👍.

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

    Hello, I love your videos and the connection you have with your cat.
    ¿Can you make how use animation blend?, Regards from Panamá

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

      Glad you enjoyed them! I do go over some animation blends in this tutorial in the animation section ua-cam.com/video/rY71U1nHrBc/v-deo.html is there a particular thing you would like to see with blends?