# 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

`boolean`

Sets the visibility of the VFXPreset.

#### Code Samples

```lua
local VFXPreset = script.Parent

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

### InfiniteLoop

`boolean`

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.

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/vfxpreset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
