Search Unity

Circular Gravity Force

Discussion in 'Assets and Asset Store' started by LaneMax, Dec 13, 2013.

  1. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Yep, the assets are still supported and work with the newest Unity versions. CGF is feature complete... there is a change that I might start work on the new Unity physics types when they are released, but will have to wait tell Unity has then in the wild. SSS has a few updates coming out that support more Unity 2D and 3D joint types. Hope this helps

    Cheers
     
  2. InfiniteDesign8

    InfiniteDesign8

    Joined:
    Aug 22, 2017
    Posts:
    38
    Platformer pro 2 is using it's own physics, no ridgidbody...any idea on work around?
     
  3. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    CGF only work with Unitys physic, the only workaround that I can think of is you'll need to add a Unity ridgidbody 2d or 3d, and a Unity collider 2d or 3d in order for it to work. I'm not really familiar with Platformer pro 2 so don't really know to main details on that end, don't know if this helps or not. Let me know if you make any progress

    Cheers
     
  4. PunkPuffin

    PunkPuffin

    Joined:
    Jun 17, 2018
    Posts:
    14
    Than
    Thanks for the reply. Purchased both SSS and CGF

    Look forward to have a bash with some ideas
     
  5. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Cool, good luck!
     
  6. PantrrBleue

    PantrrBleue

    Joined:
    Aug 16, 2019
    Posts:
    2
    Hello,

    I would need help regarding the rotation of an object placed on a sphere / planet. I would like to make sure that the player (a capsule) can turn around the planet without falling himself, here are some drawings to illustrate what I need ... It's a 3d game but the drawing is done in 2d to make it more understandable. Thank you in advance for your reply upload_2020-1-17_19-17-39.png
     
  7. wayneh654

    wayneh654

    Joined:
    Nov 25, 2012
    Posts:
    15
    Hi Pantrr.
    Take a look at a add-on in the Assets store called CGF (Circular Gravity Force). It will do what you are after here and so much more.
     
  8. sancha-km

    sancha-km

    Joined:
    Jun 5, 2016
    Posts:
    41
    Hi,
    1. All is working cool in Editor, but in build after 1-2 minutes of using CGF(magnets) some objects dissappear
    2. This is characters with ragdoll, (puppet master asset) and primitives with rigid body
    3. On magnets i create a link between two, to throw objects from first to second magnet, (change collider in script in first on second magnet).
    4. Primitives created in Probuilder(integrated in Unity standart tool in 2019)
    5. Unity 2019.2f1
    Why this can happen?

    Fixed problem - this happens when i deactivate gameobject with CGF script, if keep it active and set Force power\Size to zero, all is working fine.
     
    Last edited: Apr 26, 2020
  9. eTech3D

    eTech3D

    Joined:
    Feb 2, 2014
    Posts:
    18
    Hello @LaneMax
    May I know the name of the song in the trailer,
     
  10. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey eTech3D I got It off envato.com but it looks like its no longer available sadly
     
  11. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    New update is now live!

    5.2.0f1
    -- Added new Force Type 'Velocity', sets the velocity to the objects.
    -- Added new Force Type 'Angular Velocity',sets the angular velocity to the objects.
    -- Added 'Lerp Velocity' ability for when using the force types 'Velocity' and 'Angular Velocity' to lerp between the velocity of the current objects.
    -- Added 'Counter Gravity' effect to CGF. Keep in mind if CGFs are overlapping it will apply both counters. So recommend not overlapping CGFs unless that's the desired effect.
    -- Added 'Counter Gravity Multiplier'
    -- Added gizmo effect for when using Counter Gravity to see the gravity values in the area.
    -- Bug fixed CGF effect no longer multiples itself when the rigidbody having child colliders and will only applied itself once per rigidbody.
    -- Bug fixed when CGF force equaled zero no longer turns off the CGF effect.
     
    Last edited: May 14, 2020
    julianr, hopeful and Virtuadreamer like this.
  12. eTech3D

    eTech3D

    Joined:
    Feb 2, 2014
    Posts:
    18
    Thank you @LaneMax
     
    LaneMax likes this.
  13. ZigmundDaal

    ZigmundDaal

    Joined:
    Jul 27, 2020
    Posts:
    1
    Hello, i've got a question, I'm trying to make a space related videogame and i was looking for gravity manipulation assets and i just saw yours but i haven't tried it yet, in the trailer i saw that there's only vehicles, there's any way to play with a 3rd person character like super mario galaxy?
     
  14. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    I'd like to send an event when the player gameobject enters a CGF object and when it leaves. Plus obtain the force vector so I can rotate a gameobject towards or away from the force direction.

    Would I need to add additional methods and variables to the CGF class to do this? A script example would be really helpful. Many thanks in advance.
     
    Last edited: Oct 25, 2020
  15. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hi @LaneMax and so much thanks for this great package,is it possible to simulate water volumes with buoyancy using your tool?
    Thanks in advance
     
  16. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
  17. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey Pourya-MDP sorry for the late reply, was thinking I might start a discord channel so I stay more on top of questions like these. I think you would be able to do this using the CGF Box shape, and using a Force Type of 'Velocity' to simulate some form of buoyancy. keep in mind everything that you want this effect needs a collider and rigibody. also this would only be for the physics side, and not any cool water effects ;) Hope this helps

    Cheers
     
    Pourya-MDP likes this.
  18. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    So the only event I have listed in CGF currently is when a CGF affects an object 'CGF.OnApplyCGFEvent'. Sense CGF uses Unitys Physics.Cast system to detect the objects I don't know if there is a way to tell if it leaves a Cast or not without it being expensive. I'll try and take a look though

    Cheers!
     
  19. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hey and thanks for helping out
    And yes a discord would be so great
    So im waiting for the discord link here
    Thanks again
     
  20. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Pourya-MDP likes this.
  21. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hello there. Just curious, what is the best way to go about creating a sort of circular "stasis field". I'm looking to use a gravitational force to hold objects within a sphere, which it seems that currently when setting up a standard gravitational field, once it hits the center the object seems to launch off (which I'm guessing is a combination of the force from all direction hitting the object). What would be the best way to create a sphere which will pull objects in but then hold them in a relatively stable manner near the center of the sphere?
     
  22. wayneh654

    wayneh654

    Joined:
    Nov 25, 2012
    Posts:
    15
    Go to the Unity Web Asset Store and do a search for Circular Gravity Force. This is a add-on I got years ago and works in both 2D and 3D. It will do what you are after here.
    Enjoy
     
  23. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Yeah you should be able to do this with the content. You can also join the discord if you have questions on how to do this if you have the content =)
     
  24. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hi @LaneMax - I'm building a game that has a character that can fly around in space but will fall to a planet's surface when he's close enough to the gravitational pull and not using his "flying mode". As such, I thought of creating a simple bool that checks if he's within a grav field or not. If he is, then it would turn on the game object's rigidbody and he'll fall to the ground.

    The question is, how do I stop Circular Gravity Force from trying to turn on "useGravity' on the rigidbody all the time?

    I even tried manually turning it off during runtime and it won't turn back off.
    Is there a way to tell CGF not to interfere with that (until I say so via script)?
    I'm checking out the filters, but that doesn't quite do it.

    Any help would be much appreciated.
     
  25. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hello,

    Just curious, are there any pre-existing methods to check if an object is currently being effected by a particular gravity force? Or retrieve a list of objects the force is currently influencing?