Tumgik
#buncha gifs they are going to crash my web browser
hollylachat · 2 years
Text
mole game 2
today is febrary fifth
rewriting this because the discard button really seemed intriguing to me like 10 minutes ago i dont know what came over me. I had gotten like so much more then i thought i would yesterday. you actually get super powers in learning when ur actively putting off a college paper.
I be recording bits and pieces of the process of putting it all together idk how much i want to describe in detail, it really takes alot of time to say it all.
I did finally open up that unity program and make a cube, hard part was makin it move
I decided i was gonna use the new unity input system module thing, idk shiny new thing obviously better, no way it isnt, then it like wouldnt be new and i wouldnt be using it.
funny thing is that i spent 30 minutes tryna optimize code and shit because i thought i messed up and was laggin my game, but the like context menu for the player input module just straight up lags the game look at this
Tumblr media
i was usin the character controller module to setup the movement and i was tryna use the SimpleMove() function, which should've just taken raw inputs and added gravity, which should've been fine for my game since i don't need a jump and the character wouldn't need to be affected by physics. However it seems like that function is kinda awful, like it doesn't seem to work with Time.deltaTime or have a built in clock, so its all studdery and gets faster when at lower framerates, which i was able to test with my trusty player input context menu lol
Tumblr media
yeah but then i just kinda rewrote it in the Move() function and manually just did the funny "+ Physics.gravity" and it just kinda works
void Update(){
characterController.Move((moveVector * moveSpeed + Physics.gravity) * Time.deltaTime);
}
public void Move(InputAction.CallbackContext moveAmount){
vectorBeforeTranslation = moveAmount.ReadValue<Vector2>();
moveVector.Set(vectorBeforeTranslation.x, 0, vectorBeforeTranslation.y);
}
so yeah this is all u need for a character controller folks i hope this helped and i hope someone bullies me for this at some point moveVector is a Vector3 and vectorBeforeTranslation is a Vector2 declared empty earlier in the class.
Now then was to make the character rotate, idk i kinda did it but not really but like hey look holy shit the cube is moving
Tumblr media
i like couldnt figure out how make a transition so that the rotation looked clean so i kinda threw out that code
Tumblr media
so i guess i just decided that i would work on making the character face my mouse, this was a travesty
a mixture of deciphering how to grab the mouse position from the input system garbage and deciphering how to convert it into real coordinates in the actual game
its like difficult finding any material for understanding quaternions on like a programming or unity level, like i dont actually need to know quaternions just show me where to plug the variables, it seems like the internet is deadset on giving me alternatives so that i never have to touch it so i ended up using the LookAt() function and inserted the mouse position which like semi worked
Tumblr media
it made it look towards the ground which was goofy, but also i fixed this by just pretending like the y axis of the mouse position was the same as the character :^)
Tumblr media
thats about all i achieved, i spent a long time tryna make a sort of transition for the rotation of the character for like some game feel or something, but idk i can do that later.
i think the next big thing is to work on terrain and how its gonna be destroyed, im lookin into like how to variably change like the vertices and stuff on a mesh, not looking to win any rewards, just dont wanna end up using blocks or somethin stupid for the rocks and shit.
I also gotta research alot into shaders for how i want the insides of the tunnels you would be creating would be.
seems like this would be the stage that would cause burnout since I'm not really sure where to go on from here but i guess ill just learn more about the engine and come back at another day.
one thing to note is that I tried to make my code like modular so i can use them again at a later date, thats probably a fairly good idea, always thought it was weird how much people online tell you to split up ur code and nonsense but dont tell you how they personally do it or like explain how ur supposed to come up with your own system on ur own projects.
hoping seeing so many nonsense libraries and doin so much damn math in my head doesn't rob me of my personality
2 notes · View notes