# Simulating gravity when moving up or down an incline

**URL:** <https://forums.unrealengine.com/t/simulating-gravity-when-moving-up-or-down-an-incline/260378>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 11, 2021, 8:14am UTC](https://forums.unrealengine.com/t/simulating-gravity-when-moving-up-or-down-an-incline/260378 "2021-11-11T08:14:09Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 13, 2021, 2:54pm UTC](https://forums.unrealengine.com/t/simulating-gravity-when-moving-up-or-down-an-incline/260378/14 "2021-11-13T14:54:45Z")

</div>

> [@usa423](#):
>
> Would that then be the best choice for like a tank blast? Like the body of the tank being kicked back by the force of the turret firing?

Sure, why not. Add Impulse:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/7/07b6e40ecdc8dc4ee00db6f9a7eb0528a5896c3d.png)

Perfect if only the suspension wasn’t a slab of concrete… 😉

* * *

> How would you describe the difference between Add force and PhysicsThruster?

Add Force at Location vs Thruster Component. One is a node and the other a component. Apart from that, there’s no difference under the hood; there’s hardly anything on the C++ level in the comp. It’s just a ticking component with a single var. Use it as a base class and flesh it out, so it actually does something interesting - it being a component makes it easy to attach to things and move around / point at things. You can do it in BPs, too:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/3/5370f55e61d2c0fd2018e4db91a25cfaf49cc05d.jpeg)

* * *

> Add Force / Impulse at Location - Could you describe that better to me?

If you’re not using location, you’re applying the force / impulse at the root (UE4’s physics implementation supports component welding - so there’s more to it, actually). Doing it _at location_ instead, allows you to do this:

You choose _where_ the force / impulse is applied. If you wanted to tip a big box over, you’d push the top edge. If a flying drone has 6 engines, to make it fly correctly, you’d apply forces where the engines are located to give it stability.

* * *

> Set Physics Linear Velocity node. Will this node work standalone or does it need another node to function? So then once its target is connected to a physics enabled mesh, I could simply type in say 100 Z either plus or minus and receive a push or pull of 100 units in the Z on the static mesh?

It’s just a single node. It literally overrides the physics state. Whatever you were doing before, now you’re doing this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/9/19dc8f209bb8aa0a6f62b741a1152993be407fb1.png)

This is quite different from Adding force / impulse as it disregards the previous state. If your supersoldier had the ability to deflect bullets back at the enemies, you could use this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/3/d3834b9c5e325ca742ff6948fa9d4d77d81a5e9a.png)

…and even dare to ignore the friendly warning it comes with.

* * *

> But that is just the thing, no physics, I have seen a lot of tutorials that seem to use Delta as the main mechanism of propulsion for flying craft.

You sure can, but that’s not physically accurate, and not a simulation. That’s unless you write enough code (a lot) to essentially achieve a custom physics engine…

There are lot of forces affecting a plane in flight. A single thruster would produce the same effect as attaching a fan to a piece of cardboard. It would fly, just not very well.

Have a look at the threads below, they really go into details - these 2 are literal gold mines:

> [@\[OPEN-SOURCE\] Machinery Modelling Toolkit](https://forums.unrealengine.com/t/open-source-machinery-modelling-toolkit/54422):
>
> \*\*No C++ is needed, this works as Rama’s Victory plugin - it adds extra nodes and classed to BP. There is no need to write C++ code unless you really want to smiley \*\* Feature plans The long term plan is to extend plugin with more functions which a necessary for physics calculations and add more components that can be used as building blocks to model whatever you want. Components such as wheels, tracks, springs, suspension, airfoil, engine, gear box and many more. Small bui…

> [@\[ASSETS\] \[OPEN SOURCE\] Tanks, tracks and N-wheeled vehicles](https://forums.unrealengine.com/t/assets-open-source-tanks-tracks-and-n-wheeled-vehicles/41018):
>
> Hi guys, I was working on a prototype of off-road tracked vehicle similar to this amphibious beast of engineering: [[- YouTube] ](https://www.youtube.com/watch?v=ky16Ac7Q7yU) It was obvious that I should look into PhysX’s tank implementation but I’ve decided that first I want to get my own implementation in blueprints, to better understand what kind of forces are involved in simulation and how far you have to go in respect to reference materials. Prototype started with a huge vehicle, supported by 10 wheels of 2 meter diamete…

---

_[View the full topic](https://forums.unrealengine.com/t/simulating-gravity-when-moving-up-or-down-an-incline/260378)._
