Let’s Build! #4 - Chemistry Table

Date: 18 Oct. 2021

Goal of this session

Make a chemistry system where you can pick bottles and add liquid to another bottle.

letsbuild4

What we covered

Replay

Timecodes of each part

0:00 Setup the scene
7:30 Grab an item / Equipment
13:00 Detect when the player press F / Trigger
18:40 Add blue liquid / Update Object Properties from a script
36:30 Add more types of ingredients / Material API
45:10 Improve script
49:30 Use the new system
52:15 Use Data in Hierarchy with Custom Properties
01:03:00 Use and explain the system

Template of the system

I've added an IK system that was not explained in the session so that the player is moving his hand at the top of the bottle.
I've just added in the project a Right Hand IK Anchor next to the top of the bottle and then I used Activate and Deactivate in the AddIngredient function to enable and disable the IK.

PBT file (drop it in your Core window and then drag and drop the template in your scene)

Challenges

Download the template and improve the system:

  • When a new bottle is equipped, place the current one at his place on the table (Weapon unequippedEvent)
  • Enhance animation
  • Enhance the visual of the bottles so that when it is in the hand, it is not above the hand
3 Likes