# CowsinsUtilities

Contains different utilities and functions that are accessible to use from any script.

{% hint style="warning" %}
If you want to use Cowsins Utilities, ensure you are using the cowsins library by adding the next snippet on top of your script:
{% endhint %}

```csharp
using cowsins;
```

{% hint style="info" %}
CowsinsUtilities is a `static class`.
{% endhint %}

### Utilities | CowsinsUtilities.cs

> <mark style="color:green;">GetSpreadDirection (float amount, Camera camera)</mark>
>
> Returns a Vector3 that applies spread to the bullets. This is used in [WeaponController](https://cowsinss-organization.gitbook.io/fps-engine-documentation/content/03.-content/03.4-weapons/weaponcontroller)
>
> * **amount**: Amount of Spread to apply.
> * **camera**: Camera to calculate spread from.

> <mark style="color:green;">PlayAnim (string anim, Animator animator)</mark>
>
> Plays the specified animation on the specified Animator using Triggers.
>
> * **anim**: Name of the Animation To Play
> * **animator**: Animator to play the anim on.

> <mark style="color:green;">ForcePlayAnim (string anim, Animator animator)</mark>
>
> Force to play the specified animation on the specified Animator ignoring transitions
>
> * **anim**: Name of the Animation To Play
> * **animator**: Animator to play the anim on.

> <mark style="color:green;">StartAnim (string anim, Animator animator)</mark>
>
> Plays the specified animation on the specified Animator using Booleans.
>
> * **anim**: Name of the Animation To Play
> * **animator**: Animator to play the anim on.

> <mark style="color:green;">StartAnim (string anim, Animator animator)</mark>
>
> Stops the specified animation on the specified Animator using Booleans.
>
> * **anim**: Name of the Animation To Play
> * **animator**: Animator to play the anim on.

> <mark style="color:green;">SavePreset (Object source, string name)</mark>
>
> Saves a Preset.
>
> * **source**: Preset to save. This can be any object.
> * **name**: Names the Preset.

> <mark style="color:green;">ApplyPreset(Preset preset, Object target)</mark>
>
> Loads a Preset onto an object
>
> * **preset**: Preset to load.&#x20;
> * **target**: Object to apply the preset to. This can be any object.

> <mark style="color:green;">EmptyString(string string\_)</mark>
>
> Returns true if the string is empty
>
> * **string\_**: String to verify.

> <mark style="color:green;">GetDamageableParent(Transform child)</mark>
>
> Given an object, finds if there is a parent that is an IDamageable
>
> * **child**: Transform to verify.


---

# 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://cowsinss-organization.gitbook.io/fps-engine-documentation/content/03.-content/03.8-extra/utilities/cowsinsutilities.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.
