Docs

Throw Control: Mobile & Desktop ☄

Advanced Throwing System for Unity

Throw Control is highly customizable Advanced Throwing System for Unity.
Just throw anything!

All modules are designed independently to keep this asset extendable & easy to understand.

Available in the Unity Asset Store.

Features

  • Cross-platform: Mobile, Desktop (Mouse);
  • 2 Throwing Modes: “Flick” & “Click Or Tap”;
  • 3 Demos (including FPS);
  • 5 Events;
  • 10 customized Throwing Objects;
  • Easy implementation of your own Throwing Objects;
  • Tons of Customizable Parameters;
  • Dynamic Sound System (depends on Speed of Throwing Object);
  • Layer Changing (actual for quick Throwing to neutralize mutual collisions);
  • Fade Out;
  • Object Pool.

5 Events:

  • OnThrow,
  • OnNextThrowGetting,
  • OnReset,
  • OnFadeOut,
  • OnInitialized.

Tons of Customizable Parameters

Input sensitivity, force, torque, delays, position, rotation, etc.

  • For all Throwing Objects at once,
  • For each Throwing Objects individually.

10 customized Throwing Objects

3 Demos

  • FPS Demo integrated with FPSController from Standard Assets by Unity Technologies (Desktop):
    • Throw force takes into account the speed of the player’s movement;
  • 2 Demos with a static position of the player in “Flick” & “Click Or Tap” modes (Mobile & Desktop);

Use Cases

Modes

The higher click (or tap) position on the screen, the greater the strength of the throw.

Click Or Tap

In this mode, game object is throwing in the direction of the click (desktop) or tap (mobile).

FPS

For FPS game there is an option for fixing input position in a specific place on the screen (by default in the center of the screen).

Flick

In this mode, you must take the Game Object and throw it in the style of Pokemon GO game (by flicking it from the bottom of the screen up toward the target).

Is Full Path For Flick?

If it’s false then it allows fast flicks only: positions in the last and previous frames are taken into account.

Scripts

Throwing system consists of three control scripts.

Throwing Object

The script contains basic functions and parameters to operate Throwing Object.
This script must be attached to each Throwing Prefab (check tutorial).

Throw Control

This is the main script that manages throw & all Throwing Objects on a scene.
The script uses disabling and enabling the following nodes: Colliders, Triggers, Renderers.

Coroutines

The only script that uses coroutines calls.

Because of coroutines behavior, it is impossible to place some methods inside Throwing Object script.
OOP does not work in this case, but we have a stable throwing with Object Pool.

Random Object Pooler

This is improved Object Pooler script by Unity Technologies.

Features

  • Prefabs Using:
    • Single (actual for Testing target prefab; None => Multiple),
    • Multiple;
  • Generation order for Multiple Prefabs:
    • In random order,
    • In the right order;
  • Event:
    • OnInitialized;
  • Customizable pool parent &  init pooled amount.

Colliders, Rotation (Torque) & Center of Mass

There are some nuances with Rigidbody.centerOfMass when rotation.

Symmetric Mesh

If you use Mesh Collider for Throwing Game Object and your mesh is ideally symmetric then it is the perfect case and game object will throw naturally.

Asymmetric Mesh

If you use Mesh Collider for Throwing Game Object and your mesh is asymmetric then you will have unnatural throw behavior when rotation.

Solution 1: Custom Center of Mass

You can indicate Custom Center of Mass manually in the Editor.
Package contains some examples with Custom Center of Mass.

There is no magic function which calculates right Center of Mass.

Solution 2: Simple forms of colliders

You need to use one or more simple forms of colliders (box, sphere, etc.) placing them on the same Throwing Game Object and along the straight line. So in this case, we have a right center of mass & right rotation.

Tutorial

“Getting Started with Throw Control”

For legal reasons, I can’t include some assets in the package, but you can get them for free separately.

If you have any issues with the first launch then just email me with Invoice Number and I will send you complete project.

I used next software for this tutorial:

  • Unity 2018.1.2;

Steps

  1. Download and import Throw Control into Unity;
  2. Download and import Standard Assets by Unity Technologies;
  3. Reopen Unity project;
  4. Test in the Unity Editor;
  5. Build for Mobile or Desktop.

“How to create your own Trowing Object Prefab?”

I used Unity 2017.3.1p4 and Demo Scene (included in the package) for this tutorial.

  1. Create Prefab with a template:
    1. Drag one of the customized throwing prefabs into the scene,
    2. Name your Game Object,
    3. Drag named Game Object into Project View to create your own Prefab;
  2. Select Game Object on the Scene & Customize it:
    1. Indicate Mesh in Mesh Filter component,
    2. Indicate Material in Mesh Renderer component,
    3. Customize Colliders:
      1. Indicate Mesh in Mesh Collider component (or in more suitable collider component);
    4. Option: Customize Center of Mass for more natural Throwing;
  3. Customise Transform component as you wish;
  4. Apply Changes to Prefab;
  5. Delete Game Object from Scene;
  6. Add Prefab to Random Object Pooler;
  7. Throw your Game Object. 🦆

Option: Fade Out Customizing

  1. Change Shader of Material to Shader with the Main Color property (e.g. Legacy Shaders > Bumped Diffuse),
  2. Duplicate Material in the Project View and name it (i.e [MaterialName]_FadeOut),
  3. Change Shader of Duplicated Material to Shader from the Transparent Shader Family (e.g. Legacy Shaders > Transparent > Bumped Diffuse),
  4. Indicate both materials in the Fade Out Section of Throwing Objects Script in Throwing Prefab.

Screenshots

Download

Unity Asset Store | Download Button

Support

First of all, read the latest docs online.
If it didn’t help, get the support (info@makaka.org).

Changelog

Show Version History

3.6: Unity 2018.2 & Hotfix for Flick Mode

  • Unity 2018.2 version;
  • Fix errors: When Flick Mode you just click on the object without finger position change.

3.5: New 10 customized Throwing Objects

3.4: Layer Changing in Throw Control

Actual for quick Throwing to neutralize mutual collisions.

  • Customizations:
    • ON / OFF,
    • Layer Mask on Throw,
    • Layer Mask on Reset,
    • Delay.

3.3: Throw Customizations in Throw Control

  • Input Sensitivity,
  • Force Factor Extra,
  • Torque Factor Extra,
  • Torque Angle Extra,
  • Parent on Throw.

3.2: “Flick” Mode Customizations in Throw Control

  • Option: Is Full Path:
    • If it’s false then it allows fast flicks only (positions in the last and previous frames are taken into account);
  • Lerp Time Factor On Touch.

3.1: FPS Mode

  • FPS Demo integrated with FPSController from Standard Assets by Unity Technologies (Desktop);
  • Throw force takes into account the speed of the player’s movement;
  • Fixing input position in a specific place on the screen (by default in the center of the screen).

3.0: New Architecture: Throw Control

Main Control Script (Throw Control) operates Object Pool & All Throwing Objects now (Throwing Object Script is attached to each Throwing Object prefab).

Work Scheme:

  1. Initialize Pool,
  2. Initialize Throwing Objects,
  3. Get the First Throw,
  4. Get Next Throw.
  • Customizations in Throw Control:
    • Throw Mode;
    • Events with Delays:
      • OnInitialized,
      • OnThrow,
      • OnNextThrowGetting,
      • OnReset,
      • OnFadeOut.

2.6: Rotation Customizations

  • Option: Rotate Object in Throw Direction;
  • Rotation on Reset:
    • Default,
    • Last,
    • Random,
    • Custom.

2.5: Position Customization

  • Position in Viewport On Reset.

2.4: Center of Mass Customizations

  • Custom Center of Mass,
  • Logging of Center of Mass by Default.

2.3: Torque Customizations

  • Torque Axis,
  • Torque Angle,
  • Torque Factor,
  • Max Angular Velocity at Awake.

2.2: Force Customizations

  • Force Factor,
  • Force Direction Extra.

2.1: New Throwing Mode: “Click or Tap”

  • “Click or Tap” Throwing Mode  for Desktop & Mobiles;
  • Customization:
    • Throwing Mode.

2.0: Object Pool: Throwing of Multiple Objects

  • Prefabs Using:
    • Single (actual for Testing target prefab; None => Multiple),
    • Multiple;
  • Generation order for Multiple Prefabs:
    • In random order,
    • In the right order;
  • Customizations:
    • Pool Parent,
    • Init pooled amount,
    • Event (OnInitialized).

1.3: Dynamic Sound System

Sound System depending on Speed of Throwing Object.

  • Customizations:
    • Array for randomly selecting Sounds,
    • Speed Clamping,
    • Pitch (Minimum & Factor),
    • Volume Factor.

1.2: Fade Out

Fade Out option for Thrown Objects.

  • Customizations:
    • ON / OFF,
    • Delay,
    • Speed,
    • Materials,
    • Event (OnInitialized).

1.1: Desktop Version

  • Desktop version for Mouse. Use it for Standalone apps or for testing of mobile apps in Unity Editor.

1.0: “Flick” Throwing Mode for Mobiles

Check detailed Map of Unity Assets

Everything in sight

Amazing!

How are my Unity Assets related to each other? ▷ The sharp tip shows that the ancestor contains this product.

Open Map of Unity Assets
User Rating: 5( 4 votes)

Andrew Sirota

Hi, friend! I am Founder at Makaka Games. I love Augmented Reality. I am open for communication and ready to implement your craziest ideas. Today we are Starting a new Experiment.

Related Articles

Leave a Reply

Check Also

Close