---
description: v1.0
---

# Raycast Shooter + Handlers

`RaycastShooter.cs` can be added to Projectiles that deal with raycasts, such as lasers. Check the demo scene lasers to see how this is used.

All components in this and child objects which implement `IHandleRaycasts` will be included as handlers, and will be given the information they need to potentially act.

<figure><img src="https://2431624982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MY3N_li2jPq7az6mYfq%2Fuploads%2FrAJD7Upst9o6cAbpvNpn%2FScreenshot%202024-04-02%20at%206.18.48%E2%80%AFPM.png?alt=media&#x26;token=9f7867ca-1912-4ace-9b25-5951049d3bd7" alt=""><figcaption></figcaption></figure>

### Origin & Offset

This determines where the `Raycast` will begin, often it will be the parent objects `Transform`. Max Distance determines how far the `Raycast` will travel.

### Raycast Interval

A value of -1 means the `Raycast` will fire every frame. Otherwise, it will fire periodically.

### Max Shots

A value of -1 means unlimited shots. Otherwise, the `Raycast` will fire a set number of times, an no more.

### Start Delay

This will delay the first `Raycast` check. This is useful for Projectiles where there is a warmup period before the projectile is "on" in the game.

### Include Inactive Handlers

When `true`, `IHandleRaycasts` on inactive objects will be included in the handler list. This is often desired, as some child objects may not be turned on right away, but still need to act based on the `Raycast` results.

## `IHandleRaycast` Classes

Any class which implements `IHandleRaycast` will be used as a handler of `RaycastShooter.cs` if it is a child of that object, and will get the `Hit` information from the raycast.

### Collision At Raycast Hit Point

`CollisionAtRaycastHitPoint.cs` will trigger a `Collision` on all objects within a specified radius, from the [**Projectile**](../projectile) set in the component.

### Set Position From Raycast

`SetPositionFromRaycast.cs` will set the position of an object based on the `Raycast Hit` data. This is useful for positioning things like an "impact" particle at the end of a `Raycast`.

This does not have to be placed on the object being positioned! If you add this to another object, you can specify another object to be positioned, and can optionally turn on that object only when it is positioned, which may be a more desirable result.

### Line Renderer Length

`LineRendererLength.cs` will set the position and length of a `LineRenderer` by the `Raycast Hit`. There are additional options to help draw the line appropriately for the length.

### Line Renderer Length and Oscillation

`LineRendererLengthAndOscillation.cs` derives from `LineRendererLength.cs` and adds some oscillation effects. It was made specifically for the integration with [**Sci-Fi Effects by FORGE3D**](../../3rd-party-particle-integrations-16/forge3d-1/sci-fi-effects), but will work with other similar particles.

### Line Renderer Frame Animation

`LineRendererFrameAnimation.cs` was made specifically for the integration with [**Sci-Fi Effects by FORGE3D**](../../3rd-party-particle-integrations-16/forge3d-1/sci-fi-effects). It will animate a `LineRenderer` while using the `Raycast Hit` to determine the position of the line.

{% hint style="success" %}
**Create your own IHandleRaycasts classes!**

You can create your own classes which implement `IHandleRaycasts` and use them in conjuction with the Raycast Shooter to enable new features and functionality specific to your project.
{% endhint %}
