# TweenService

TweenService : `Instance`

## Overview

TweenService allows the creation of tween Objects for animation effects

The functionality of a tween depends on the properties set during its creation.

<table><thead><tr><th width="180.6666259765625">DataType</th><th>Usage Example</th></tr></thead><tbody><tr><td>CFrame</td><td>CFrame</td></tr><tr><td>Vector3</td><td>Position, Orientation, Size</td></tr><tr><td>Color3</td><td>Color</td></tr><tr><td>number</td><td>Transparency</td></tr><tr><td>bool</td><td>CanCollide</td></tr><tr><td>UDim2</td><td>Position, Size</td></tr></tbody></table>

## Properties

## Methods

### Create

Creates a new tween animation for a specific instance. Arguments passed to the Create() method define the instance to apply the tween to, the TweenInfo defining the tween's behavior, and the properties apply tween to.

#### Parameters

| `Instance` Instance   | The target tween Object                                                  |
| --------------------- | ------------------------------------------------------------------------ |
| `TweenInfo` TweenInfo | An Object that sets the duration, EasingStyle, and repeat count of tween |
| `Value` PropertyTable | A dictionary defining the properties and target values to apply tween to |

#### Return

| `Instance` | The created tween Object |
| ---------- | ------------------------ |

#### Code Samples

```lua
local TweenService = game:GetService("TweenService")
local Part = script.Parent 

-- Setting Tween information
local TweenInfoData = TweenInfo.new(
    5,                         -- Time               
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite) 
    false,                     -- Reverses
    0                          -- DelayTime
)

-- Properties to be changed with the tween
local TweenGoals = 
{
    Position = Vector3.new(-400, 50, -350)
}

local Tween = TweenService:Create(Part, TweenInfoData, TweenGoals)
Tween:Play()
```

## Events

## See also

{% content-ref url="../../../manual/script-manual/advanced-gameplay-systems/tween" %}
[tween](https://docs.overdare.com/manual/script-manual/advanced-gameplay-systems/tween)
{% endcontent-ref %}
