Good morning, everyone. This is day 1 of this super casual jam.
We're going to be making a game using PlayFab
over two days. I'm really excited.
I have a really fun idea that I'm going to be sharing with you
and we're going to be using Unity to do this C#.
We're going to be making our assets in Maya, maybe some blender,
and by the end of the weekend we should have a game to play.
The idea I have for the game is I'm going to be using some assets
from the game I've been working on, my main game strain,
and I have a character who's rigged and working.
I can use this character to animate.
I want to do a 3D platform game,
but you could do movements in two dimensions.
We're going to be viewing it from the side,
but it's going to look 3D.
I think it will look really cool and it
will be fun to try doing a game in the style,
I'm hoping is something that can be done
in two days. We will find out.
Let's start by bringing in some
of Unity's components that I like to work with.
We want set a machine,
we're going to want post-processing,
we're going to want some do tween,
I like doing folders that are: one, 3D, two, materials.
Three, images, four, audio, five, prefabs, six,
scenes, seven, scripts, eight, parts.
The first thing we're going to want to do is get the character
moving around in a environment.
Here is going to be our plan, super casual jam plan.
Import the character, which we did,
get character to move around in an environments,
stopping at walls like hitting the ground obviously,
and then doing actions would be cool.
Punching, if we're going to make it a fighting game.
Jumping, running, enemies, health for player and enemies.
Varied attacks, stamina.
Maybe a start and finish, score, win.
We'll start with those things.
I think the first step is to give her a rigid body,
give her an animation.
Next up, we'll want punching.
That's going to be best. Jumping, we're going to want.
That might be good for jumping up and down. These are cool.
First of these guys, I want to make sure that
they're humanoid, they're configured.
The animation is looping and
matching the original position of things.
These will make sure that it loops,
that it goes through pits the pose that it started in,
so it's not like moving around in
the scene and then we're going add jump up,
so we're going to rename to jump up.
I'll match this to the Unity Humanoid character so that our rig
will be able to work just the same way as the one
in the animation and then sync up nicely.
Running for running. That one needs adjustment here.
Jumping up, jumping down and we're going want a rigid body.
This is going to be little tricky.
Let's put this inside of a and then put the rigid body.
I think I'm going to do it on this.
We want it to be the exact height of her.
Here we are, so far, walking around the scene.
The way that we did this was by putting
a nav mesh on our scene using Unity's AI.
You can see it here.
This shows where the colliders are.
These are static objects.
You can see here, I've set them to static in the inspector.
In our navigator, if you've clicked on the object,
I say that these ones are not walkable
and the ground object is walkable.
Then when I bake it, the agent here,
which we put on the character over
here on our capsule that's surrounding our character,
we have a nav mesh agent and that will now
know that blue area is a walkable space.
Then in our code, what we did, we set that up,
we got the nav mesh agent from our character.
I got a near distance of how far the character should be to stop.
Then on update,
if the mouse button gets clicked,
we get a ray cast screen point to ray.
We get that hit point.
Set that as a destination.
Then during update
again if they're in the walking state, which we set here,
then and their distance is
less than the near distance to their destination,
then we set them back to idle.
That, once again, looks like this. Not too bad.
I also adjusted some of the nav mesh options
here so that the character would turn around faster.
I'm using angular speed.
We set the speed and
the acceleration to match correctly with the animation.
We can even get her to come forward.
What I could do is put
invisible obstacles if I don't want her
to be able to go deeper into the scene.
I don't think we need to worry about that.
I think it looks good as it is.
We have now a camera following our movement,
we used Cinemachine,
put in a virtual camera and do we have no look at,
we have the follow,
connect it to the character, and after some trouble found out,
thank you to chat for the suggestion of using world space.
That way, it doesn't lock to
the character's rotation and it can smoothly go back and forth.
We also put in a test building here to see how that works.
We experimented with doing it in a orthographic view.
But I think we're going to start with perspective
and maybe do an option switch between down the road,
but lets stick to perspective for now.
We now have our character searching boxes.
Basically, if you look at our code in our update function,
we check if the ray cast hits the object.
The object is on a certain layer called pick up.
If it hits an object on a pickup,
then we will check if we're far away from it.
If we are, we'll set that as a destination.
Get the player walking again.
If we're right nearby it,
we'll just make sure that the character is looking at it,
and then we'll say that we've reached the item.
Otherwise, we'll wait till our character
reaches the item while they're walking.
Here, when they start searching,
they will do the animation.
Within the animation itself,
over here in Unity in the animator,
we have an event on the animation.
On our animator, we have a script Anim
controls where it says done searching.
Once we're done searching,
we add that to our inventory and update it,
delete the object from the scene,
and we set our current target to nothing
and we set our player to be null
again or the current game object to be null.
Here's what it looks like. She goes down,
she starts searching the objects.
Then once she gets to the done point in the animation,
it disappears, add it to her inventory and she stands up.
She's within the collider of this,
so she doesn't have to start walking towards it.
She just bends over and picks it up.
We'll start searching through it
and picks it up at the end of that.
Well, there we go.
Now we're going to change this over to be
a piece of rubble so they look correct.
I think our next steps are going to be
a day night cycle and a health stat that will go down over time.
Then we'll need to make sure that there's a reason for the loop.
At night, there's going to probably be other people coming out
that might attack you or maybe help will go down faster.
But first, we need a day night cycle and the health going down.
We now, as you can see, have a health bar.
The health slowly goes down over time.
If it goes to zero, you get a game over and we go back
to the title screen that we added.
For the title screen,
we basically made a simple scene with
just a button to quit the game and to start the game.
All of those two scenes with
an overlay and a Canvas group that will fade
in and out to make the scene feel a little bit more dramatic,
a little bit more pretty.
On the character itself, we added a world space Canvas.
Let me find that. Sorry, I added it instead.
Not on the main Game Object,
but on the body. Here it is.
This way it ends to the character's top piece of the spine,
like this area, so that if
they're bending over, if they're looking around.
The height will match this area.
Looking down, looking around.
Then I put a script on that to ensure that it faces
the camera and stay centered on the player. Let's take a look.
Here, from the title screen, that fades in.
You can quit with that.
You can start the game with play.
It's in, and now we have our player
walking around with this helper.
When we pick it up, it follows the player.
When that hit zero,
it will fade out and go back to the title screen.
I don't have yet a falling down animation,
but I think that would be a good one.
Same with, I don't think we should be able to click
or interact with anything once we get to zero health.
We also want to be able to use the items in our inventory here.
We have two bags of chips.
In a moment, we'll have three.
If we use them, we'll have hotkeys attached to them.
If we use them, that should restore some health.
We'll have the game over
animation on the character and then that health bar.
We have put in a bed, it's a little bit messy.
The character can go over here,
gets in to bed, looks like she is getting in to bed. Makes sense.
But importantly, health bar goes up and when it's done,
she's back up on her feet ready to go.
If she goes and she's partway through sleeping,
then when we get up, it's continues to go back down.
When she's not resting, we put in some rubble.
Now, when she goes and digs through that,
it makes a little bit more sense than just a cube.
She'll find an item, can't
see it here because it's dark, but it's chips.
If we press one, restores health,
stays up for a minute until it goes down again.
We just imported some assets.
We're going to start bringing those together
and putting together the level a bit better.
I also want to do it so that when she looks for items
in the rubble that she'll find different things.
We brought in some assets.
We started making it look cool.
Some assets work better than others,
but I think we're off to a good start.
We are now going to import PlayFab,
so and we're going to get the PlayFab SDK for Unity.
There is that and then there's
the Unity Editor extension asset pack.
We're going to bring both of those
into the project when we're not in play mode,
import, and the other one import,
and I've logged into my PlayFab account over here.
We're going to make a new studio.
Studio is going to be called Vo-ID C91,
name of the virus in the game.
Let's save that studio info and we're
going to be setting it up in our game.
I have it here with my other studios.
I've set up here and we are going to make our title.
I think I'm going to call it that for now.
That will be the code name for until it's got
a final name and we can make it a revival simulation maybe,
single-player, read a play, and Windows Save "Title."
Once you have those two things then you can go
to "Window", "PlayFab",
"Editor Extensions", and then you're going to use
this part here to log in to your accounts.
I don't do that without you guys peeking.
When you go to "Settings", "API features",
you're going to want to allow client to post
player statistics that should give me the access to save and load.
Now, we're set up to do PlayFab.
We're going to do a few more things today, a little touch ups,
and then, I think, we're going to start tomorrow off by
implementing a log in with PlayFab,
saving and loading with PlayFab, and then we'll put
in the last parts of the game tomorrow.