Tuesday, April 28, 2020

FMP: Week 17 Tuesday

On Tuesday I continued with the blueprints, this time working on making the characters heads follow the player! Firstly though, I realised that it would be easier to have each animation blueprint be a child of a single parent blueprint. The issue was... I was using two separate sets of bones: one for the original character model, and one for the updated tiger model. The parent and children all had to have the same set of bones, so, I decided to assign a new skeleton to the fisher character and retarget the animations (another new skill for the book I guess). I went onto each skeleton and used the retarget manager to set up a rig by assigning each bone to a source and a target, which was then replicated for the other set of bones:

I also went into the advanced list so I could set fingers and other extra bones
I then right clicked on my animation asset for the tiger and clicked on retarget, selecting the NPC_Skeleton from the list of compatible skeletons, and went through with the change. There were some issues where different parts of the body became enlarged or stretched a little bit, but that was solved by going into the skeleton tree within the animation and showing the re-targeting options.

I changed everything to skeleton other than the Bip and the Pelvis,
which were set to animation and animation scaled respectively.
All of this was done following these two tutorials [link] [link].

After this was done, I started on the lookat blueprints using this tutorial:
EventGraph: Checking if the owning actor is valid, and if so executes the
custom function setting the self actor as the owner, and the look at target as the player.

First section: setting the maximum amount of head turn (so necks don't snap),
setting itself as a variable and making sure it isn't the player character and the socket location is valid.
Second section: finding the target location, making a rotation to follow it for both the pitch and yaw of the head
as well as checking the rotation of the head against the maximum yaw.
Final section: if the rotation exceeds the maximum yaw, it resets the head rotation to the original one, if not, it continues to rotate. I also added some boolean variables here to check whether or not the player is in viewing range to turn off the animation when not in use.
Animgraph showing final animation pose, where the alpha is whether or not the head is to move or not.
Child blueprint that sets the alpha depending on whether or not the character is A: in the collision range of actor blueprint itself, and B: in range of the head turn.

No comments:

Post a Comment