-
Notifications
You must be signed in to change notification settings - Fork 0
[Smoothie] Smooth Head
Usually the head always looks where the player is looking. By using this you can make the turning process smoother. You can also change the rotation strenght and head tilt for a more realistic head turn.
To make the head turn smoother, 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 head.
For example:models.model.root.Head -
Use
newSmoothHead()
For example:local smoothHead = smoothie:newSmoothHead(models.model.root.Head)
Final example:
local smoothie = require("Smoothie")
local smoothHead = smoothie:newSmoothHead(models.model.root.Head)Sets the head rotation strength
setStrength()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The head rotation strength | 1 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
smooothHead:setStrength(0.75) -- Now the head will not turn all the waySets the head rotation speed
setSpeed()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The speed at which the head will turn | 1 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
smooothHead:setSpeed(2) -- Now the head will turn twice as fastSets the head tilt multiplier
setTiltMultiplier()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The head tilt multiplier | 1 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
smooothHead:setTiltMultiplier(3)When you create a new smooth head, the model part that you give as a parameter loses its parent type, and with it the movement of the model part when you crouching and in other poses.
setKeepVanillaPosition()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| state | Boolean | The speed at which the head will turn | true |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
smooothHead:setKeepVanillaPosition(false) -- Don't crouch, or you'll rip your head off