Welcome to my blog!

Sunday, July 30, 2023

Cricket In Unity with Game Creator #1

This is the first actual project that I am carrying out in my Unity Game Dev internship. And I hope Game Creator makes it pretty smooth.

First the task at hand: Create mechanics for batsmen in Cricket
- Create at least 5 different types of strikes

If you don't know what cricket is, why even are you here :/


So let's dive into it. What did I complete today you ask?

1. Setting up the character & scene: The first thing to get started was obviously to build up the scene and the character. For the scene, I took a simple stadium model for playing Cricket that can be found here. This also provided me extra work as the creator did not provide any textures that it contained. So being the lazy one that I am, I deleted all the unwanted stuff, added appropriate colors and just put the field only which looked like this:


Then setting up the character was really easy with Game Creator, with just a click of a button. Then I found a 3D model from Mixamo and made the character feel more human. This also gave me some extra work as the textures didn't appear :( . And finally beholdd my mighty character:


Since I have Game Creator I was happy I did not have to work on movements and controls here and there. But oh boy, so wrong I was. I will have to change all the animations phew!!
As for the camera, I kept a camera motor fixed behind the player since for now I am only focusing on the batsmen. 

I also added a second camera motor so that I can look around. I made a key down trigger that swaps the camera to another adventure camera.




2. Animation: Now I needed the player to sit in an idle position where cricket batsmen usually sit. Since T-pose wouldn't cut out for it. I went straight to Blender with what little knowledge I had and got to work. After a while, I got something that satisfied me :) 
 
(I'm really proud of this btw)
I also tried some left-right movements, but let's leave it for another day.


3. Attaching Bat 🤔: This is where it all got a bit tricky. I thought of three individual ways for attaching the bat to the player.
  1. Directly placing the bat on the hand of the player under the root bone with the right transformation and the bat would move along with the hand.
  2. Using player attachment provided by Game Creator to attach the bat on the hand of the player with some trigger. (Lots of trial and error to get the rotation and position right)


  3. Then the last one was to directly attach the bat to the model itself in blender. This would be really smooth and perfect. But I really don't want to use blender T_T
So what did I do? 
For now, I am still trying to figure it out. But I have placed the bat under the right-hand bone of the character with proper position and rotation.

Looking back at it, I think this is all I did today. Doesn't feel like much when you write like this. Especially since I didn't have to do any coding either (Thanks Game Creator I guess). It ain't much but its honest work. I also tried to add a little hitting animation with a trigger but the bat's location is really messed up I guess



Share:

0 comments:

Post a Comment

Labels

About Me

My photo
Kathmandu, Central Development Region, Nepal