[Music]
hi welcome to mix and jam Patel about
game development experimentation today's
project is based on God of War for the
PlayStation 4 in the newest game of the
series Kratos has the ability to throw
his axe and pull it back making for a
mechanic that feels and looks great
my goal for this project is to try and
create a similar mechanic using unity
here are the steps I needed to follow
first I needed to add animations for all
of the character motions then I needed
to work on the axe throw itself in which
the axe is the attach from the player
and moves forward while rotating the axe
collision that makes it stick to the
walls and the axe return where the axe
returns to its original position with a
small curve for this project I created a
third person character control following
this video from film storm that teaches
how to create that kind of camera
control using cinema sheen I also
downloaded this model of kratos axe from
Dan Harlow in sketchfab and like the
last video I downloaded some animations
on Maximo to use on the project I
started by applying to download
animations into the character animator
on munities animator we can organize the
character motions create transitions
between them and set parameters that we
can modify by using code in my case I
used code to set a walking parameter on
whenever the character moves so the
animator could transition to the proper
animation
by using the same technique I was able
to set the aiming and throw an animation
[Music]
for the axe throw the first thing I did
was to add a rigidbody component to the
axe to avoid it from being affected by
gravity have said that is kinematic
property on encode all I needed to do
for the throw to work was to D attach
the axe from the player by sending its
parent so no setting the is kinematic
property off and adding a force to the
rigidbody by throwing the axe and
playing the animation at the same time
the axe is thrown way before the
animation reaches the proper frame to
fix that I went into the throw animation
and created an animation event exactly
at the frame I wanted the throw to
happen on the animation event I simply
called the throw function on my script
in the game the axe rotates while moving
forward so I replicated that by creating
a script on the axe that changes its
Euler angles on update
on that same script I added unities on
collision enter function to detect
whenever the axe collides so in that
function I just made the axe freeze by
setting is kinematic on the rigidbody to
true
to make the axe return I use some of the
techniques I found in this video from
Omar in which he also records the same
extra use immunity this video really
helped me a lot so shout out to him in
his video he uses lerp to make the axe
return and he also uses a quadratic
Bezier curve to make the axe do an arc
when returning I did the same thing and
placed an empty object as a child of the
character to use it as a middle curve
point
for when the ax is returning I added a
pull animation for the character now for
some polish I added some basic particle
effects to the ax one for the glow of
the axe that uses the mesh as a shape
for its emission and another for when
the axe is kept with a single admission
of a bunch of particles I also added a
trail renderer to the ax as well to
improve an animation a bit more I did an
extra animation State for when the axe
is catched to make the motion have more
impact to add even more a sense of
impact on the catch
Iannetta scream shakes the camera by
using cinema Sheen's impact extension
and called it in code
i refined the particles and trail by
changing their material and just for
experimentation
I added some breakable boxes I did on
the scene so the axe could break them
and then finally I added some
post-processing to add some effects to
the camera like bloom depth of field and
motion blur after some minor adjustments
this is how it turned out
[Music]
as always the link for the project's
repository is on the description below
if you have anything you would like to
see being made on a video let me know in
the comments if you enjoyed this video
don't forget to like it share with
friends and subscribe to the channel if
you haven't there's much more to come
I'll see you in the next one
[Music]
you
[Music]