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.
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!
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?
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
@@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(); } }
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
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?
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.
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 ;)
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?
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.
Awesome content! Definitely interested to see how you achieved that shader effect as well :)
Thanks! I’ll try and make one about the shader, maybe show a few variations like for crystals and such
@@PabloMakes Nice, sounds interesting!
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!
awwww , from the title, i thought you were going to make this via shader graph... lol
but i like it anyway~~ cheers~
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?
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
@@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.
@@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();
}
}
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
Hi Frosty did you ever get your copy animation to work?
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?
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.
@@PabloMakes Thanks for the insight! That cleared up a lot of the questions in my head regarding the topic.
Great video! It would be really cool if you could make a video about the shader of distort appearance.
Glad you enjoyed it. I’ll plan a video for that, lots of cool stuff can be done with that
nice video ty
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 ;)
Looks like a few people are interested so I’ll make it happen!
great tutorial 👍.
Glad you enjoyed it!
Hello, I love your videos and the connection you have with your cat.
¿Can you make how use animation blend?, Regards from Panamá
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?