# Missile Projectile

Start by generating a new Actor named "BP\_Missile." Set up an Arrow component as the Root of the actor and attach a Cone component to it. This establishes the basic structure of the missile actor.

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2FWQQbgHJSabWxRgZ2SFZg%2FUntitled.png?alt=media&#x26;token=3368b5a5-e8b0-4025-bc81-76a03562c7e2" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2Fm8sQacUbE66sCHmRK8zL%2FUntitled.png?alt=media&#x26;token=d5cf0f80-7e24-442b-b192-18c4211cb331" alt=""><figcaption></figcaption></figure>

In the Tick function of the "BP\_Missile" Actor, implement logic to make the missile move towards the positive x-direction. Update the actor's location accordingly during each tick to achieve the desired forward movement.

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2F5IfGOiKvrxf3BIXCfTOY%2FUntitled.png?alt=media&#x26;token=20f652bb-a553-4564-89b0-a6e740f41aa8" alt=""><figcaption></figcaption></figure>

Extend the functionality of the "BP\_Missile" Actor by adding both the Mnh Tracer and Mnh Capsule components. Attach the Mnh Capsule to the previously added Cone component, ensure the Hitbox is configured appropriately for accurate hit detection.

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2FAG5XQBfhf8p1gt3esNLi%2FUntitled.png?alt=media&#x26;token=6f2f58d5-dd35-44c1-8662-ead23bfeaefc" alt=""><figcaption></figcaption></figure>

Setup Tracer parameters as follows.

Tracer Tag → Missile

Trace Source → Mnh Shape Component

Draw Debug Type → For One Frame

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2FBcXXJy1wMMAWuH1Mb8Hr%2FUntitled.png?alt=media&#x26;token=2da1610f-5260-4fd5-9730-28e1a6229dde" alt=""><figcaption></figcaption></figure>

In the Begin Play event, initialize the tracer by calling the "Initialize Tracers" node. Supply the Mnh Capsule component as the source and set "Missile" as the Tracer Tag.

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2Fa84PYUp4ohZF8MdcqLna%2FUntitled.png?alt=media&#x26;token=d8023691-86ee-4357-b2b8-4acf6bdcfc4a" alt=""><figcaption></figcaption></figure>

After initializing the tracers with "Initialize Tracers," proceed to call the "Start All Tracers" node. Additionally, set up the "On Hit" event to spawn the Niagara system and destroy the actor upon a successful hit.

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2FDPzaLc9NHc8XWz8aw987%2FUntitled.png?alt=media&#x26;token=5ae7f8ae-a058-4e9e-a926-a89b5d16ac15" alt=""><figcaption></figcaption></figure>

With the provided setup, your missile should now move forward until it encounters an object. Upon contact, it will trigger the Mnh Tracer's hit detection, leading to the execution of the "On Hit" event. This event, as configured in the previous steps, will spawn the explosion effect using the Niagara system at the impact point and then destroy the missile actor.

For fun: Increase the missile speed to 5 million and observe as Miss No Hit accurately registers hits even at extreme conditions!

<figure><img src="https://2614465389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhXtfCgw8FokTHnCnF7So%2Fuploads%2FCSWewiQvylogUGGP9nTA%2FUntitled.png?alt=media&#x26;token=e1d79a52-78d7-4979-865f-b5c2c8920d8e" alt=""><figcaption></figcaption></figure>
