# \[Released\] 2D Gravity Kit

**URL:** https://discussions.unity.com/t/released-2d-gravity-kit/649023
**Category:** Community Showcases
**Tags:** Asset-Store-Assets
**Created:** [December 14, 2016, 5:57pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023 "2016-12-14T17:57:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 14, 2016, 5:57pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/1 "2016-12-14T17:57:09Z")

</div>

Hi,

I am currently working on this project which make the character walk on Planets/Platforms of any shapes.  
Check out this [demo](http://deadpixel.biz/Assets/2DGravityPlanet/)

Work on every shapes  
Characters with different size work well on it

Also, can make some awesome bigs planets (even clouds rotate on differents speed)

Ideas

- If you have some ideas about this project, please post here OR send a email to [volkov40@hotmail.com](mailto:volkov40@hotmail.com) and I will glady add it to the projects.

Best regards,

---

<div class="post-metadata">

### Author: ![pixelsteam](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/pixelsteam/32/292778_2.png) [@pixelsteam](https://discussions.unity.com/u/pixelsteam)
#### Post date: [December 14, 2016, 6:08pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/2 "2016-12-14T18:08:34Z")

</div>

This would also be great if in certain cases the object rotated, but character stayed in same place.

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 14, 2016, 6:46pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/3 "2016-12-14T18:46:13Z")

</div>

> [@pixelsteam](#):
>
> This would also be great if in certain cases the object rotated, but character stayed in same place.

Can you explain a little more?

Best regards,

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 15, 2016, 6:32pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/4 "2016-12-15T18:32:12Z")

</div>

Update many features.

- Characters can now start on any angle on the planet
- Characters can now Jump
- Created Sample 2 which is a big planets showing how powerfull this can be 🙂

Anyone interested?

Best regards,

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 16, 2016, 5:48pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/5 "2016-12-16T17:48:05Z")

</div>

Just made a video showing this package!

[![](https://europe1.discourse-cdn.com/unity/original/4X/6/1/b/61bb36e40e6761f77c3ad70b6a38108454ce1377.jpeg "2D Gravity Kit") ](https://www.youtube.com/watch?v=Ly9Cmdgl0fc)

Enjoy!

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 17, 2016, 12:52pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/6 "2016-12-17T12:52:35Z")

</div>

It has been sent to the Asset Store so now it’s in Pending.  
All you have to do is waiting to be available on the store!

Also, just updated the demo with the last version.

Best regards,

---

<div class="post-metadata">

### Author: ![p6r](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/p6r/32/477716_2.png) [@p6r](https://discussions.unity.com/u/p6r)
#### Post date: [December 17, 2016, 2:59pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/7 "2016-12-17T14:59:39Z")

</div>

Very nice. Good idea !  
Can a character jump to another near planet ?  
6R

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 17, 2016, 5:38pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/8 "2016-12-17T17:38:21Z")

</div>

Not yet, but it will definitely be in the next patch 🙂

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 20, 2016, 7:38pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/9 "2016-12-20T19:38:09Z")

</div>

> [@p6r](#):
>
> Very nice. Good idea !  
> Can a character jump to another near planet ?  
> 6R

There you go. Just finished coding the option on the character to be able to change planets when jumping.  
You must be nearby and jump.

Check out this [demo](http://deadpixel.biz/Assets/2DGravityPlanet/)

Best regards,

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 21, 2016, 7:18pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/10 "2016-12-21T19:18:47Z")

</div>

Just created a Sample 3 which show how you can create planets around other planets and use them to move between them. Also each planet has their own Clouds, Gravity.  
Add some rotation to make it harder for the player to walk between them.

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 23, 2016, 7:58pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/11 "2016-12-23T19:58:53Z")

</div>

I decided to add Projectile in this project which mean, the player will be able to shoot with a gun and the projectile will use this gravity and hit the other character on the other side of the planets.

Sounds a good idea? I’ll post a update when it’s done

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [December 29, 2016, 1:53pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/12 "2016-12-29T13:53:26Z")

</div>

Just updated again with many new features !

[Demo](http://deadpixel.biz/Assets/2DGravityPlanet/)

- Now planets can be Increased/Decreased when jumping on a switch. Also, everything on the planets keep their own scale and they get back to position. When increasing/decreasing, the appropriate sound is played.  

- Also, coded Projectile when pressing SPACE. The Projectile will be created on the same direction of the character and will follow until it dissapear. In another patch, it will collide with enemy character which will be destroyed. Also, there will have Spawner who will create enemy character until you destroy it. (VERY SOON)  

Leave a post if you want any new features.

What’s coming next?

- Changing gravity between planets
- Creating zone which will use 2D Gravity & Normal Gravity (Up/Down). Ex : Your outside a space shuttle and you enter it, you will now be walking normally. Not on wall or roof. Then you go back outside, then you can walk anywhere on the ships.
- Objects 2D Gravity (Crates, Jar… ) When changing gravity, the object can rotate itself and be on the top or right side. Characters are always on their 2x legs.
- Many enemys which will make the game better (Enemy Ships, Enemy Probes)
- Advanced Projectiles (Missile, Arrow using the Bezier curve)

Best regards,

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [January 4, 2017, 2:32pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/13 "2017-01-04T14:32:25Z")

</div>

Hello there,

[Demo](http://deadpixel.biz/Assets/2DGravityPlanet) has been updated again with new samples to be tested.  
I’ve been working busy on this project and here is the latest patch so far!

I’ve done Teleport between Planet which mean also the Projectile are being teleported and killing stuff on the other side.

Also, it can teleport the character in the right gravity side. Even if the planet is rotating…

I added Impact on the projectile when hurting Plateform OR Walls which is not on the same planet.

I also created a new function for the Switch which change the gravity of all the childs on a planet on a new one.

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [January 11, 2017, 2:15am UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/14 "2017-01-11T02:15:10Z")

</div>

Hello,

The package is now available on [Unity Store](https://www.assetstore.unity3d.com/en/#!/content/78449)  
The latest patch is on it’s way so you can have features as the Demo!

If you have any request, feel free to post in this forum or send me a email to [volkov40@hotmail.com](mailto:volkov40@hotmail.com).

best regards,

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [January 11, 2017, 5:22pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/15 "2017-01-11T17:22:00Z")

</div>

bump

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [May 9, 2017, 4:45pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/16 "2017-05-09T16:45:12Z")

</div>

Here is the new update coming to the asset store!

There are now 2x type of projectile.  
Bullets and Missiles. Bullet will follow planet gravity and go around it.  
Missile are different. They will go where you aim it and explode killing hostile NPC.

Also, the crates can now be pushed in the teleport.

---

<div class="post-metadata">

### Author: ![VanDarkholm](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@VanDarkholm](https://discussions.unity.com/u/VanDarkholm)
#### Post date: [June 5, 2017, 11:14pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/17 "2017-06-05T23:14:26Z")

</div>

Hi, I was working with your asset and noticed that the player’s sprite is missing. When I add the sprite, the player just dropped infinitely in the space. For now, I can only change a character comes with the planet to a normal player, but the sprite is still in “enemy” form no matter how many times I change it. Can you provide a detailed description on what components a character needs? Thanks!

---

<div class="post-metadata">

### Author: ![dude4004](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dude4004/32/164453_2.png) [@dude4004](https://discussions.unity.com/u/dude4004)
#### Post date: [June 6, 2017, 12:34pm UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/18 "2017-06-06T12:34:37Z")

</div>

When you launch the default scene, the player start and fall ?  
Did you try to delete the whole folder and download the project again?

Because on my side, the player has the sprite.

If this doesn’t work, send me a printscreen showing the character script.  
Here is the default one here

---

<div class="post-metadata">

### Author: ![haywirephoenix](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@haywirephoenix](https://discussions.unity.com/u/haywirephoenix)
#### Post date: [September 24, 2018, 9:14am UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/19 "2018-09-24T09:14:49Z")

</div>

Hi, I recently purchased 2d gravity kit, it’s great! I’m testing performance and it can cause quite large framerate drops when using many instances. This is where I’m at so far with optimisation and wondering if you have any advice.

- Removed rigidbody

- Removed collider

- Enabled gpu instancing on Material

- Commented out all of the Debug.drawray lines, and the checks for mouse position (they don’t use weapons)

- Moved everything in FixedUpdate into a function called CheckPosition()

In FixedUpdate I’m just doing: ```  
if (vCurPlanet == null || !Grounded)  
CheckPosition();

```auto

Grounded = true is currently being set next to vFoundGround = true (~line 408?) I don't think this is the right place for it to go as they no longer complete their full rotation before stopping.

I only really need to update their rotation if they decide to move (wander). They also don't need to jump planets. My thinking is that once they know their position and rotation relative to the planet, they don't need to constantly update. Are you able to point me to where they should be set to fully grounded and do you have any ideas on further optimisation?

Any advice would be fantastic. Looking forward to hearing from you!
```

---

<div class="post-metadata">

### Author: ![haywirephoenix](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@haywirephoenix](https://discussions.unity.com/u/haywirephoenix)
#### Post date: [October 21, 2018, 9:57am UTC](https://discussions.unity.com/t/released-2d-gravity-kit/649023/20 "2018-10-21T09:57:07Z")

</div>

Can you provide an update or example for using this in the new entity component and job system?
