The only thing I couldn’t figure out in my VFX graph after I cloned V1’s scaling settings yesterday was the particle size. At the scale I use in V1, my particles look invisible. I guessed that maybe the HDRP config had something to do with the discrepancy, but after copying those settings from V1, I still had the same issue. Oh well, that part doesn’t matter too much.
I started my to-do list in order, copying the particle initialization animation to a tee from V1. Because I want to potentially add animations for the other hand states, I created a helper function to play any animation after a given delay.
Naturally, this led me to the second item on my to-do list, changing the behavior of the WayOut point. I decided to do a bit more digging in V1’s code before changing the behavior of my particle emitter transforms. I’m glad I did, because the technique I used back then won’t work anymore. I need to come up with a new solution quickly, because the ability to push and release the energy ball in any direction is one of the most fun features of V1—an absolute must have.
I think I’ve come up with an extremely elegant solution. I sure hope it works. Here’s the gist of it:
if (player.leftHandState == HandState.Closed
&& player.rightHandState == HandState.Closed)
{
player.vfxGraph.SetFloat("spawnRate", 0);
}
else {
player.vfxGraph.SetFloat("spawnRate", 4000);
// do push to target stuff here
}
How funny would it be if this worked?? I’m super excited to test. My thinking behind this is that if the body stops getting pushed toward the target, then by nature of its rigidbody physics, it will just continue traveling along the direction it was headed to.
My goodness—it worked! I’m gonna need these simple victories as I rush to get this project ready.
I added some extra force to the pushes using a nice technique… When the hands first close, I run the PushToTarget function one last time, with a special caveat—I scale the force vector by a scaler and set the drag of the body to 0. It looks great, but unfortunately I’m not quick enough to grab a recording of it. I need to figure out a better way to grab recordings now that I’m away from my computer. I’ve tried looking for a recorder program that can snag a specific part of the screen after a delay, but haven’t found anything yet. Maybe I can just use the Unity Recorder. Not important right now, but it would make for a better Dev Log.