All Projects → JohannesDeml → Adaptinggravityunity3d

JohannesDeml / Adaptinggravityunity3d

Licence: mit
Discontinued - A small library for gravity that adapts to the ground normal the player is standing on

Programming Languages

gravity
16 projects

Projects that are alternatives of or similar to Adaptinggravityunity3d

Tork
Arcade vehicle physics for Unity
Stars: ✭ 256 (+966.67%)
Mutual labels:  unity, physics
Vivegrip
Physics-based grabbing for SteamVR development in Unity.
Stars: ✭ 159 (+562.5%)
Mutual labels:  unity, physics
Gpu Physics Unity
Through this configuration, no per voxel data is transferred between the GPU and the CPU at runtime.
Stars: ✭ 342 (+1325%)
Mutual labels:  unity, physics
Mathutilities
A collection of some of the neat math and physics tricks that I've collected over the last few years.
Stars: ✭ 2,815 (+11629.17%)
Mutual labels:  unity, physics
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+15066.67%)
Mutual labels:  unity, physics
Unity Destruction
💥 An open-source script to destroy objects realistically in Unity3D.
Stars: ✭ 291 (+1112.5%)
Mutual labels:  unity, physics
Randomation Vehicle Physics
Vehicle physics system for the Unity engine.
Stars: ✭ 487 (+1929.17%)
Mutual labels:  unity, physics
Centrifuge
Cross-platform runtime mod loader and API for any Unity-based game. Supports Unity 5 and up!
Stars: ✭ 18 (-25%)
Mutual labels:  unity
Tracerysharp
C#/Unity port of Tracery (heavily WIP)
Stars: ✭ 19 (-20.83%)
Mutual labels:  unity
Entitypostprocessor2d
A unity package for applying post-processing effects to assembled 2D assets
Stars: ✭ 17 (-29.17%)
Mutual labels:  unity
Unitykonashi
konashi unity wrapper
Stars: ✭ 6 (-75%)
Mutual labels:  unity
Webxr Physics
Adds physics to WebXR
Stars: ✭ 18 (-25%)
Mutual labels:  physics
Unitydbgdraw
DbgDraw is an API that provides the ability to render various 2D and 3D shapes for visual debugging purposes.
Stars: ✭ 20 (-16.67%)
Mutual labels:  unity
Buttons And Boxes
A Sokoban-esque puzzle game developed in unity 3D in 2016
Stars: ✭ 17 (-29.17%)
Mutual labels:  unity
Unity Ml Environments
This repository features game simulations as machine learning environments to experiment with deep learning approaches such as deep reinforcement learning inside of Unity.
Stars: ✭ 23 (-4.17%)
Mutual labels:  unity
Googleads Mobile Unity
Official Unity Plugin for the Google Mobile Ads SDK
Stars: ✭ 837 (+3387.5%)
Mutual labels:  unity
Unity Powershell
PowerShell module for managing EMC Unity arrays
Stars: ✭ 23 (-4.17%)
Mutual labels:  unity
Looper
A resource list for causality in statistics, data science and physics
Stars: ✭ 23 (-4.17%)
Mutual labels:  physics
Hldoc
Half-Life game physics described in excruciating detail!
Stars: ✭ 19 (-20.83%)
Mutual labels:  physics
Ffmpegoutbinaries
Separated binary package of FFmpegOut Unity plugin
Stars: ✭ 19 (-20.83%)
Mutual labels:  unity

Adapting gravity for Unity3D

Discontinued, maybe KaimaChen/How-To could be another interesting reference for you.

Introduction

Think of games like super mario galaxy. Mario can jump from one planet to another and run on those small spheres without problems. Also in racing games the tracks are often not just on the ground. With this repository I want offer a small library to create exactly such gravity adaption possibilities.

Technical overview

To get the desired effect all objects that should adapt to gravity check for ground objects via ray-casts. If they find a ground object near them, they save the normal map of the surface and take the negative surface normal as the new gravity direction. A screenshot of the unity editor in which a cube is on a larger sphere. From the cube a green line is drawn in the current gravity direction

Usage

To use the library you have to make changes for every object that should be attracting as well as for every object that should be influenced by gravity. The introduction of adapting gravity can be accomplished by those few steps:

  1. Add the AdaptingGravity script to all objects that should attracted by adapting gravity. You can also start by only adding it to your player. You find the script in Deml/Physics/Gravity. If you are starting your project from scratch you can add the prefab player from Deml/Player/Prefabs/Player.
  2. Once the script is on the player you can tweak specific settings for it.
  3. The attracting object tags will define which tags should be considered to be attracting to the player.
  4. The gravity strength defines the strength the player will be attracted to objects. The acceleration is set in m/s². (Side note: The gravity strength of the earth would be 9.81 m/s², but in games you would normally use a greater strength)
  5. The gravity check distance defines the distance of the ray that will check of objects that are able to attract the object
  6. The ground check distance defines the distance for which an object will be seen as touching the ground. This could be relevant if you want to only be able to move with the player if it is touching the ground.
    A screenshot of unity3D that shows the parameters that can be changed through the editor
  7. If you want the player to perfectly rotate to the current gravity direction also add the script LockFallingOver to the player object. It can be found in AdaptingGravity/Scripts/Physics/Manipulation
  8. Add one of the tags you defined are valid for attracting objects (You defined them in step 2.1, if you didn't the standard value is only the tag "Ground") to all objects you want to be attracting to other objects.
  9. You can where the evaluation of ground objects should happen by adding handles to the object. You will find a button for that in the GravityHandler script.
    Add handles by pressing the button. Afterwards you can rotate and transform them the way you are used to
  10. With the weigted average toogle you can define if the gravity should be defined by the direction of the nearest object that is hit by a ray or by the average of all objects that are hit.
  11. You're set and ready to tweak the settings to your needs.

Licence

AdaptingGravity is released under the MIT Licence.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].