Circular Gravity Force

ONLINE DOCUMENTATION

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

DEMOS: PC & MAC

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
Unity Forum
Manual
CGF Website
Resurgam Studios

1 Like

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

Done :smile:

New v2.5 is out, includes editor tool :smile:

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 :slight_smile:

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.

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 :stuck_out_tongue:
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

and

particle playground

-sorry my bad english-

Thanks for you repply

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.

Hey glunity,

Sorry for the late response, JohnRossitter 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.

1 Like

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.

Ok thanx for the answer.

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.

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

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:

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

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.

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

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