Class hours: 9:40 – 2:05
Mr. Bohmann
wbohmann@ewsd.org
Week Twenty Eight (28)
Today’s Notes
- Today is an EHS B Day
- The end of Quarter 3 is March 31st, that’s Friday
- Overdue / past due work deadline is 2:05 Friday – Check PowerSchool
9:45 Unity – Working with Rigidbody Components
The concept of “game physics” usually includes all movements and collisions than an object might have in a game. Think about a simple cannonball shot from the deck of a pirate ship. How should an object like that behave?
- It should have force as it comes out of the cannon, giving it direction and speed
- It should fly out and fall out of the air due to gravity
- If the cannonball hits another object, the cannonball has some kind of collision based on the mass and what it collides with. Check out what I mean
Before quality game engines, this used to have to be carefully programmed to look real.
In Unity, there is a build in Physics engine just for this.
Open your 2D project (called) Game Programming. Create a new 2D Scene
-name it PhysicsPractice
I have some new Sprites for you , grab what you like from my Google Drive Folder
Rigidbody and Rigidbody2D
In Unity, the physics engine is handled by a component that you attach to a game object.
For a 2D game, component is called Rigidbody2D. When you attach this component to a game object like a sprite, that object automatically comes under the control of the Unity 2D Physics engine. Objects with a Rigidbody2D component can respond realistically to physical forces such as gravity.
Rigidbody 2D Properties can be modified to make your gameObject behave more like you intend it to. For example a tennis ball is bouncy and a cannonball is not (so much).
Some Properties include:
- Mass – lets you control how much mass an object contains. The higher the mass, the harder an object is to move and the more effect it has when it collides with other objects in the game. Mass does not change how fast an object will fall.
- Gravity – controls how strongly gravity will affect your game object. Increase gravity to increase the speed that something falls (or does not – use negative numbers)
- Linear Drag – an object thrown in the air will naturally slow down due to air resistance. A beach ball has more linear drag than a rock.
- Angular Drag – Some objects spin (rotate) very easily, without much resistance like the wheel on your bike. Higher drag values will slow an objects spinning motion.
- Body Type (dynamic, kinematic or static) more on this later….
Bounce and Friction are Material Properties
In Unity we can create our own physics materials to control the behavior of our gameObjects.
The Friction value controls how much resistance is felt when an object is moving in contact with this material. A value of 0 means there is no friction or resistance at all.
The Bounciness value shows how much one object will bounce when it collides. A value of 0 means the object will not bounce at all.
Challenge: Bowling Game
Don’t worry, we won’t use any code! (well, maybe a little bit…)
- Create a new scene. Name it Bowling Game
- Set up your bowling ball sprite at the top of the screen and your pins at the bottom of the screen (10 Pins)
- Add Rigidbody 2D for your ball and pins – don’t forget the colliders
- Add physics material for pins/ball as you see fit
- You can also change the starting point of the bowling ball so it doesn’t hit the top pin directly in the center. Can you also adjust the bowling ball’s Mass, Angular Drag, Linear Drag, and Gravity Scale to produce different behavior?
- Observe and try to understand how different Rigidbody 2D properties affect your game
10:35 Break
10:45 English with Mx. Yopp
11:30 PSA WorkSession
This week you will finish your PSA. Tomorrow we’ll see a final version rendered. Preview showcase will begin at 11:30am so plan accordingly – Eevee is going to make your life easier!
For the fastest renders, switch to your GPU in preferences. Choose CUDA and then your GPU. Blender Eevee render engine and NVIDIA work well together and this switch should improve render outputs.
As always, I recommend doing image renders to a folder on your desktop. You then can open a new or existing project and add the image sequence to the Video Editing layout in Blender and render out to mp4.
or you can open your render image sequence in Adobe Premiere for editing and final mp4.
How to plan your time:
Monday: 45 minutes (11:30 – Lunch)- Tuesday: 45 minutes (11:30 – Lunch)
- Wednesday: 30 minutes (morning)
Week 28 – March 27th – 29th |
Final Editing and Publishing We’ll view all final projects on Wednesday at 11:30am! Publishing will be done Wednesday end of day – YouTube (your personal account). Refer to the Vermont Highway Safety Alliance website for detailed publishing instructions |
12:15 Lunch
12:45 Literacy in Practice
1:10 Break
1:20 20% Production Time & Guided Support
- SkillsUSA Practice
- PSA
- Lip Sync project planning – Not due until April 12th