Getting Started
EasyTurret is a streamlined turret asset that's easy to integrate into any project. Access EasyTurret classes with the namespace: using MobFarm; You may wish to start with the included demo scenes, or head to the Tutorial section. Demo Scene
Within the Demo folder are several assets that comprise the DemoScene. These assets are completely independent from core EasyTurret functionality. This folder and its contents may be deleted. The demo includes a simple gun script that shows how to interface with the turret script. This scene has a few primitive tank-like objects showing different turret settings firing on a small moving cube target. The close moving turret uses low arc ballistic intercept, the middle turret uses a slow shot speed with linear intercept and no gravity, and the furthest turret uses high arc ballistic intercept. Feel free to experiment with different settings. If you input results that cause a turret to not fire, check the following:
If the shots are missing the target:
Demo Script Scene
The scene includes a turret (no gun script), a target, and a Test Scripts object. The Test Scripts object has two scripts:
Example_SetTarget This script will send its target to the turret every frame. It starts the scene with no target. Once the scene is playing, you can drag Target 1 into its target field, and the turret will rotate to aim. Here's the part of the script that sets the target: turret.SetTarget( target, targetRigidbody ); (Note: The turret currently has no gun script. It was removed because the demo gun also sets the target and you don't want competing scripts trying to set the turret target.) Example_TurretEvents This script has be set up to recieve TurretEvents from the turret, by implementing the interface ITurretEvents. And on the turret script, the Test Scripts object has been added to the list of Event Targets. Use the check boxes to see which events are being sent, shown by Debug.Log() in the console. |
Script Reference
Demo Scrips These scripts are not necessary for MF_EasyTurret to work, and may be deleted. They simply provide example functionality to the demo scene.
|