# VFXPreset

VFXPreset : `Instance`

## Overview

This instance lets you display common in-game effects such as fire, explosions, barriers, and recovery, by selecting from a set of predefined effects

## Properties

### Color

`ColorSequence`

You can set the color of the VFXPreset using a ColorSequence.\
Assign different colors to the start and end points of the ColorSequence to create a gradual color transition effect.

#### Code Samples

```lua
local VFXPreset = script.Parent

local Time1 = 0
local Time2 = 0.5

local ColorKeyPoints = 
{ 
    ColorSequenceKeypoint.new(Time1, Color3.fromRGB(255, 0, 0)), 
    ColorSequenceKeypoint.new(Time2, Color3.fromRGB(0, 0, 255))
}

VFXPreset.Color = ColorSequence.new(ColorKeyPoints)
```

### Enabled

`bool`

Sets the visibility of the VFXPreset.

#### Code Samples

```lua
local VFXPreset = script.Parent

VFXPreset.Enabled = true
wait(3)
VFXPreset.Enabled = false
```

### InfiniteLoop

`bool`

Sets whether VFXPreset plays in an infinite loop.

If true, the set value of Loop Count is ignored and infinite loop supersedes.

#### Code Samples

### LoopCount

`number`

Sets the number of VFXPreset loops.

This value is applied only if Infinite Loop is set to false.

#### Code Samples

### PresetName

`string`

Specifies the name of the appearance preset to apply to the VFXPreset.

If an invalid or non-existent preset name is provided, the value is ignored and the current settings are preserved.

#### Code Samples

```lua
local VFXPreset = script.Parent

VFXPreset.PresetName = "Blink"
```

### Size

`number`

You can set the size of the VFXPreset.

#### Code Samples

```lua
local VFXPreset = script.Parent

VFXPreset.Size = 2
```

### Transparency

`number`

You can set the transparency of the VFXPreset.

#### Code Samples

```lua
local VFXPreset = script.Parent

VFXPreset.Transparency = 0.5
```

## Methods

### Clear

Resets the effect being rendered.&#x20;

While the ParticleEmitter’s Clear removes particles, this method re-executes the effect.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

### Emit

Provides a function to create a specified number of particles at once.

#### Parameters

| `number` ParticleCount | The number of particles to create. |
| ---------------------- | ---------------------------------- |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

## Events

## See also

{% content-ref url="../../../manual/studio-manual/object/vfx" %}
[vfx](https://docs.overdare.com/manual/studio-manual/object/vfx)
{% endcontent-ref %}
