Components - Unity Introduction
Unity Game Components Project
View the game's source code and development on GitHub: https://github.com/TwoBitCode/Components-Unity-Intruduction/tree/main
๐ Overview
This project is a Unity-based game development task focusing on creating a series of components that demonstrate different game-object behaviors. The components include a pendulum-like movement (Oscillator), continuous rotation (Rotator), a pulsing effect for a game-object, and the ability to hide/show a game-object using player input.
The project is divided into the following parts:
1. ๐ Oscillator Component - A component that moves a game object back and forth in a pendulum motion.
2. ๐ Rotator Component- A component that continuously rotates a game object around a specific axis.
3. โค๏ธ Pulsating Object - A game object (sphere) that increases and decreases in size gradually, mimicking a heartbeat.
4. ๐๏ธ Hide/Show Component - A component that allows the player to toggle the visibility of a game object using a button press.
โจ Features
๐ ๏ธ Components and Features
1. ๐ Oscillator Component
The Oscillator moves a game object back and forth in a smooth, pendulum-like motion. The movement slows down when reaching the boundaries and speeds up as it moves back to the center, similar to a real-world pendulum.
- ๐ Uses trigonometric functions to create a smooth oscillation effect.
- ๐ฏ The center of the oscillation is based on the initial position of the object in the scene.
- ๐๏ธ Parameters are customizable in Unity, allowing for control over the oscillation direction, speed, and amplitude.
-
2. ๐ Rotator Component
The Rotator continuously rotates a game object around a specified axis at a set speed.
- ๐ Rotation speed and axis can be configured in Unity's Inspector.
- โ๏ธ Simple and reusable component for any game object that requires continuous rotation.
3. โค๏ธ Pulsating Object (Heartbeat Effect)
A spherical game object that gradually grows and shrinks in size, simulating a pulsing or heartbeat effect.
- ๐ Uses a smooth, sinusoidal function to change the object's scale over time.
- โฑ๏ธ The pulsing speed and scale limits are adjustable via Unity's Inspector.
-
4. ๐๏ธ Hide/Show Component
This component allows a game object to be hidden or displayed by pressing a button. It utilizes Unity's `InputAction` to manage input events.
- ๐ Toggles visibility of the game object when a specific button is pressed.
- ๐ ๏ธ Easy to assign different input keys or buttons for customization.
๐ Labels and Annotations
In the scene, each game object includes descriptive text that explains the behavior being demonstrated:
- ๐ To create text labels, an empty GameObject with a Text Mesh Pro component is used.
- ๐จ The text properties, such as size, color, and alignment, are configured to improve visibility.
---
๐จ Customization
Each component includes parameters that can be adjusted directly in Unity's Inspector:
๐ Oscillator: Center position, speed, direction, and amplitude.
๐ Rotator: Axis of rotation and speed.
โค๏ธ Pulsating Object: Pulse speed and scale range.
๐๏ธ Hide/Show: Input key for toggling visibility.
---
๐ Contributors
- Vivian Umansky
- Miriam Nagar
Published | 8 hours ago |
Status | Released |
Category | Other |
Platforms | HTML5 |
Author | TwoBitCode |
Made with | Unity |
Leave a comment
Log in with itch.io to leave a comment.