-
Notifications
You must be signed in to change notification settings - Fork 0
[Smoothie] Ears
This adds physics to your ear when you move your head
Note
You call this function for each ear, so if you have two ears you will call this function twice(one for each ear)
To add physics to your ear, do the following:
-
Initialize Smoothie and store it in a variable.
For example:local smoothie = require("Smoothie") -
Copy the path to the model part that is the ear.
For example:models.model.root.Head.Ears.RightEar -
Use
newEar()
For example:local rightEar = smoothie:newEar(models.model.root.Head.Ears.RightEar)
Final example:
local smoothie = require("Smoothie")
local rightEar = smoothie:newEar(models.model.root.Head.Ears.RightEar)The smaller the number, the more the ear bounces
setBouncy()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | Ear bouncy | 1 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEar:setBouncy(0.5)Ear rotation speed
setSpeed()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | Ear speed | 1 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEye:setSpeed(2)The maximum angle at which the ear can rotate upward
setTopLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the ear can rotate upward | 10 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEye:setTopLimit(70)The maximum angle at which the ear can rotate downwards
setBottomLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the ear can rotate downwards | 10 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEye:setBottomLimit(70)The maximum angle at which the ear can turn to the left
setLeftLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the ear can turn to the left | 45 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEye:setLeftLimit(15)The maximum angle at which the ear can turn to the right
setRightLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the ear can turn to the right | 45 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rightEye:setRightLimit(15)