# Circular Gravity Force

**URL:** https://discussions.unity.com/t/circular-gravity-force/522976
**Category:** Community Showcases
**Tags:** Asset-Store-Assets
**Created:** [December 13, 2013, 6:30am UTC](https://discussions.unity.com/t/circular-gravity-force/522976 "2013-12-13T06:30:51Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [December 13, 2013, 6:30am UTC](https://discussions.unity.com/t/circular-gravity-force/522976/1 "2013-12-13T06:30:51Z")

</div>

**[ONLINE DOCUMENTATION](http://resurgamstudios.com/cgf-manual)**

**Circular Gravity Force** allows you to easily manipulate physics in Unity 3D with **no code required.**

**DEMOS: [PC & MAC](https://drive.google.com/open?id=1qrTZktEjxGEqsinmGJf2KTYPSjSrClJi)**

**CGF 5 Features Include:**

- Full **3D/2D** Support
- Four Different Physics Shapes: **Sphere, Box, Capsule** , and **Raycast**
- Six Different Force Types: **Force at Point, Force, Torque, Explosion Force, Gravitational Attraction, Velocity, and Angular Velocity**
- Five Different Force Modes: **Force, Impulse, Velocity Change, Acceleration, Lerp Velocity**
- Emit Force from **Closest Collider** allowing you to pick the shape of the force.
- **Velocity Damping** and **Angular Velocity Damping**
- Effects Like **Align to Force** and **No Gravity**
- **Non-Alloc Physics** Support
- Version 5 Demo Scenes **MainMenu, Car v2, Hovercraft v2, Marble**
- Version 1-4 Demo Scenes **Car, Car 2D, FPS, Hand, Hovercraft, Menu, Pinart, Planets, Planets 2D, Rocket, Rocket 2D, Vortex, Vortex 2D, Homing, and Pivot.**
- **GameObject, Tag, Layer, and Bounds, and Physical Materials** filtering
- **Events/SendMessage** Avalible for CGF
- **High Performance** and **Low Memory**
- Fully Customized **GUI, Gizmos** , and **Handles** for CGF objects
- **Full Source Code**
- **No DLLs**

**CGF** makes it incredibly easy to create and invent cars, rockets, explosions, cannons, magnets, vortexes, hovercars, planets… the possibilities are endless! The demo’s and tutorials show just how easy and powerful this package can be.

**OTHER LINKS:**  
**[Discord](https://discord.gg/KGZyncGDrb)**  
**[Unity Forum](http://forum.unity3d.com/threads/circular-gravity-force.217100/)**  
**[Manual](https://www.resurgamstudios.com/cgf-manual)**  
**[CGF Website](https://www.resurgamstudios.com/cgf)**  
**[Resurgam Studios](http://resurgamstudios.com/)**

---

<div class="post-metadata">

### Author: ![Setmaster](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/setmaster/32/175140_2.png) [@Setmaster](https://discussions.unity.com/u/Setmaster)
#### Post date: [March 22, 2014, 11:06pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/2 "2014-03-22T23:06:51Z")

</div>

You should post a link to this thread in the asset store.

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [April 3, 2014, 9:48pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/3 "2014-04-03T21:48:13Z")

</div>

Done 😄

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [April 23, 2014, 2:09am UTC](https://discussions.unity.com/t/circular-gravity-force/522976/4 "2014-04-23T02:09:36Z")

</div>

New v2.5 is out, includes editor tool 😄

---

<div class="post-metadata">

### Author: ![glunity](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@glunity](https://discussions.unity.com/u/glunity)
#### Post date: [June 22, 2014, 4:29pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/5 "2014-06-22T16:29:09Z")

</div>

Hi Lane.  
Your assert, not run the gravity force to the unite’s particles !  
nor cloth.

The rest is a good assert. Can You upgrade this to all objects in unity ?

Sorry my bad english.

Thanks 🙂

---

<div class="post-metadata">

### Author: ![JohnRossitter](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/johnrossitter/32/462456_2.png) [@JohnRossitter](https://discussions.unity.com/u/JohnRossitter)
#### Post date: [June 25, 2014, 8:29pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/6 "2014-06-25T20:29:56Z")

</div>

I believe that Particles have their own Gravity setting, Im not sure that this script would be able to effect that…I could be totally wrong though.

---

<div class="post-metadata">

### Author: ![glunity](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@glunity](https://discussions.unity.com/u/glunity)
#### Post date: [June 26, 2014, 2:55pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/7 "2014-06-26T14:55:59Z")

</div>

Thanks, John, no is possible that I had working with it.

The assert is a good work, but as I am very new in unity3d I am very confused with all.

By example, I buyed a assert to see a fantastic visual effect, but run with the pro version 😛  
I suposse that I will try in the future, when I buy the pro version… ESO ESPERO !

In my “knowledge” I suposse that the particles are objects similar to the rest in gravity resources.

I am now find a particles generator that able make objects, to join the both assert with my necessities.

I am now seen this two:  
particle dynamic magic

> **[Unity Asset Store - The Best Assets for Game Making](https://assetstore.unity.com/)**
>
> Discover the best assets for game making. Choose from our massive catalog of 2D, 3D models, SDKs, templates, and tools to speed up your game development process.

and

particle playground

> **[Unity Asset Store - The Best Assets for Game Making](https://assetstore.unity.com/)**
>
> Discover the best assets for game making. Choose from our massive catalog of 2D, 3D models, SDKs, templates, and tools to speed up your game development process.

-sorry my bad english-

Thanks for you repply

---

<div class="post-metadata">

### Author: ![dabaq](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dabaq](https://discussions.unity.com/u/dabaq)
#### Post date: [June 27, 2014, 9:39pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/8 "2014-06-27T21:39:49Z")

</div>

Does this work with 2D objects?

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [July 8, 2014, 3:09pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/9 "2014-07-08T15:09:43Z")

</div>

> [@dabaq](#):
>
> Does this work with 2D objects?

Sadly still no 2D settings, I’m still waiting on Unity to update some of there physics functions, I’m hoping this will be added in Unity 5.0. You can use the 3D gravity and constrict the the z axis for a work around.

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [July 8, 2014, 3:12pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/10 "2014-07-08T15:12:58Z")

</div>

> [@glunity](#):
>
> Thanks, John, no is possible that I had working with it.
> 
> The assert is a good work, but as I am very new in unity3d I am very confused with all.
> 
> By example, I buyed a assert to see a fantastic visual effect, but run with the pro version 😛  
> I suposse that I will try in the future, when I buy the pro version… ESO ESPERO !
> 
> In my “knowledge” I suposse that the particles are objects similar to the rest in gravity resources.
> 
> I am now find a particles generator that able make objects, to join the both assert with my necessities.
> 
> I am now seen this two:  
> particle dynamic magic  
> [https://www.assetstore.unity3d.com/en/#!/content/16175](https://www.assetstore.unity3d.com/en/#!/content/16175)
> 
> and
> 
> particle playground  
> [https://www.assetstore.unity3d.com/en/#!/content/13325](https://www.assetstore.unity3d.com/en/#!/content/13325)
> 
> -sorry my bad english-
> 
> Thanks for you repply

Hey glunity,

Sorry for the late response, [JohnRossitter](http://forum.unity3d.com/members/johnrossitter.507867/) is correct, you can only use this with objects that have a 3D rigidbody. I would agree that what you might be looking for is the Partical Playground, never tried it, but it looks cool.

---

<div class="post-metadata">

### Author: ![staincorb](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@staincorb](https://discussions.unity.com/u/staincorb)
#### Post date: [July 27, 2014, 2:13am UTC](https://discussions.unity.com/t/circular-gravity-force/522976/11 "2014-07-27T02:13:14Z")

</div>

Quick question I know I can ad spherical gravity to an object, and move it around with controls. is it also posible to have other gravity object pull in that same object ?

Also is it posible to use this in 2D ? say I just want gravity to be afected in Y and X coordinates but not Z ?

Nice tool any how, im probably going to get it, Congrats

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [July 28, 2014, 7:13pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/12 "2014-07-28T19:13:24Z")

</div>

> [@staincorb](#):
>
> Quick question I know I can ad spherical gravity to an object, and move it around with controls. is it also posible to have other gravity object pull in that same object ?
> 
> Also is it posible to use this in 2D ? say I just want gravity to be afected in Y and X coordinates but not Z ?
> 
> Nice tool any how, im probably going to get it, Congrats

Hey staincord,

Yeah you can use as many gravity objects as you want, but keep performance in mind. Sadly still no 2D settings, I’m still waiting on Unity to update some of there physics functions, I’m hoping this will be added in Unity 5.0. You can use the 3D gravity and constrict the the z axis for a work around.

---

<div class="post-metadata">

### Author: ![staincorb](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@staincorb](https://discussions.unity.com/u/staincorb)
#### Post date: [July 29, 2014, 10:14pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/13 "2014-07-29T22:14:37Z")

</div>

Ok thanx for the answer.

---

<div class="post-metadata">

### Author: ![TonanBora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/tonanbora/32/391595_2.png) [@TonanBora](https://discussions.unity.com/u/TonanBora)
#### Post date: [November 29, 2014, 9:55pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/14 "2014-11-29T21:55:04Z")

</div>

Hey Lane!  
I downloaded the Sample Assets pack that Unity released, and came across the roller ball scene.  
I then started wondering if I could create a Planet with your Circular Gravity that you could roll around on.  
Is this possible to do?  
At the moment, the player ball gets forced to the closest gravity point, and can no longer move.

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [December 7, 2014, 5:14pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/15 "2014-12-07T17:14:15Z")

</div>

Hey TonaBora, don’t know if that would work. you might try adding friction to the ball material and see if that does anything.

---

<div class="post-metadata">

### Author: ![zreese](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/zreese/32/389471_2.png) [@zreese](https://discussions.unity.com/u/zreese)
#### Post date: [December 23, 2014, 8:02pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/16 "2014-12-23T20:02:02Z")

</div>

This looks really cool. Quick question: is there a way to have the gravity force raycasting be (easily) stopped by walls or other object types?

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [December 29, 2014, 8:16am UTC](https://discussions.unity.com/t/circular-gravity-force/522976/17 "2014-12-29T08:16:17Z")

</div>

> [@zreese](#):
>
> This looks really cool. Quick question: is there a way to have the gravity force raycasting be (easily) stopped by walls or other object types?

Sure try this out:

```csharp
using UnityEngine;
using System.Collections;

//CircularGravityForce Asset
using CircularGravityForce;

public class RaycastLimiter : MonoBehaviour
{
    //Place your CircularGravity object here
    public CircularGravity cgf;
  
    //Offset of the Raycast, if needed
    public float offsetRaycast = 1f;
  
    //Max distance
    public float maxDistance = 1000f;
  
    //Debug Raycast
    public bool drawRay = true;
  
    // Use this for initialization
    void Start ()
    {
  
    }
  
    // Update is called once per frame
    void Update ()
    {
        Vector3 fwd = this.transform.TransformDirection(Vector3.forward);
      
        RaycastHit hitInfo;
      
        if (Physics.Raycast(this.transform.position, fwd, out hitInfo))
        {
            cgf.size = hitInfo.distance + offsetRaycast;
        }
        else
        {
            cgf.size = maxDistance;
        }
      
        if(drawRay)
        {
            Debug.DrawRay(this.transform.position, fwd * cgf.size, Color.red);
        }
    }
}

```

Also here is a quick demo on GitHub, you’ll need the to install the Circular Gravity Force asset once you have opened the Unity project to get the demo scene to work. Let me know if this helps. Cheers!

GitHub Link: [https://github.com/Resurgamstudios/CGF\_Raycast\_Limiter\_Demo](https://github.com/Resurgamstudios/CGF_Raycast_Limiter_Demo)

---

<div class="post-metadata">

### Author: ![timothyallan](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/timothyallan/32/315475_2.png) [@timothyallan](https://discussions.unity.com/u/timothyallan)
#### Post date: [January 16, 2015, 9:54pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/18 "2015-01-16T21:54:17Z")

</div>

Soooo, I’ve got an object moving towards a sphere, much like your planet demo. However, when it gets close to the sphere, the rotation of the object goes all bananas. I noticed that you’re using AddExplosiveForce for the application of force, which I assume is what is causing the rotation force, is there any plan for an update that will use AddForce instead so the object being affected doesn’t get blown all over rotationally? I can’t use AlignToForce either as it’s too sudden.

Edit: you’ll notice that the bullets in your planet demo also exhibit the rotation once they hit gravity.

---

<div class="post-metadata">

### Author: ![LaneMax](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lanemax/32/235326_2.png) [@LaneMax](https://discussions.unity.com/u/LaneMax)
#### Post date: [January 18, 2015, 10:32pm UTC](https://discussions.unity.com/t/circular-gravity-force/522976/19 "2015-01-18T22:32:19Z")

</div>

I’m hoping to re-evaluate more functionality around some of the planet stuff when I get some extra time, maybe even adding more force control options for when trying to simulate planet gravity. I’ll keep you updated

---

<div class="post-metadata">

### Author: ![timothyallan](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/timothyallan/32/315475_2.png) [@timothyallan](https://discussions.unity.com/u/timothyallan)
#### Post date: [January 19, 2015, 12:04am UTC](https://discussions.unity.com/t/circular-gravity-force/522976/20 "2015-01-19T00:04:52Z")

</div>

Okay cool. I ended up rolling my own, but it lacks the cool visualizations of yours 🙂 I’ll keep an eye out for updates though!

[Next page](https://discussions.unity.com/t/circular-gravity-force/522976.md?page=2)
