I should let you know that some of this stuff is already built-in engine code. The gravity, physics, bounce, and slip is built in. The grab script, and player was made by me. Made this post to give credit to the Unity engine devs.
Ground Check In
I’ve added in a ground check for my player. This ensures that you can’t double, triple, and infinity jump after leaving the ground. Just one jump is all you got (says no when you try to jump in the air).
The only problem is that whenever there’s a small, unnoticeable gap between the ground and the player, the ground check thinks that the player is still in the air. Thus, not allowing the player to jump. I plan to get that fixed the next Free Friday, hopefully leaving me with enough time to work on more important matters.
Boring Update
Basically added floating circle, and triangle. I also updated jumping again.
Infinite jumping still exists, but it’s more of tap jumping instead of press and hold to zoom up.
Downtown gravity
The player is now affected by gravity. And to polish upward movement, I left some parts of the code commented(if I truly need it again, but I doubt I will). Going up is more powerful than elevator music for this block. However, I need to add a ground check to ensure that the player doesn’t float up into space whenever I leave the spacebar. Speaking of which, I should make it so that the spacebar can be used to go up. Anyways, enjoy this comparison.
Before
Vector2 direction = new Vector2(xInput, yInput).normalized;
body.velocity = direction * speed;
After
//Vector2 direction = new Vector2(xInput, yInput).normalized;
//body.velocity = direction * speed;
Tossing them boxes
Remember that goal I set last Free Friday(not counting the Django post) to start tossing boxes? Well if you haven’t seen the video I posted first, I call mission accomplished. So instead of the mouse doing the work, I plan on having the hand(circle) drag the boxes whenever it’s colliding with them.

Unorthodox for the standard drag and drop, but that’s the point. I predict that this concept will have dirty execution, which will make this a big accomplishment when done right.
Django
Today I worked on a Django assignment, and encountered an error that I couldn’t find the reason why it was there. This is a cry for help. I spent the whole class working on this error, and it’s still there.

Dragging them boxes
After telling myself ” I’ll work on the hard stuff(mouse radius and fixing collisions) later “, I decided to make a drag script for my objects. Fun fact, it works(kinda).
There’s some iffy moments in the code, but what I plan to focus on the next Free Friday is being able to throw the objects whenever I let go.

I should let you know that this senior project is more of me learning about C Sharp instead of creating an actual game that would normally take less time to make than the time I’m taking right now.
Also, I’ve disabled collisions on the hand so I can test this stuff out.
Fixed it!
Good news: I was able to get the hand to not collide with the player.
Bad news: I didn’t establish the establish the radius between my mouse and player
Weird news: I’ve now offset the hand from my cursor, and the collisions between the hand and blue 0 gravity box is weird.
At least the bug has been squashed. Now we got a couple more(probably more than that) to go.
Still stuck
I’m still stuck with the hand and body issue. On the flip side, I got duplicating blocks.
I better get this problem fixed before I get struck with a condition called “nevergettingstuffdone-itus”.
Moving issues and Collision detection
So I decided to move all my mouse code into the player and… Well, you can see for yourself.
This issue can easily be resolved by having the hand collision not apply to the player, but that would require me to detect the collisions. Now pay attention to 0.09 to 0.11 in the video. If you couldn’t tell, whenever the player collides with the blue box, it prints ” yay ” in the log. Now all I need to do is have it apply to the hand, and instead of printing messages, have it not slingshot my character out of existence.