# FGear Vehicle Physics (v1.4)

**URL:** <https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793>\
**Category:** UE Marketplace\
**Tags:** unreal-engine, fab\
**Created:** [July 16, 2019, 4:10pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793 "2019-07-16T16:10:39Z")\
**Posts on this page:** 20\
**Page:** 19

<div class="post-metadata">

**Author:** ![Last\_Coin\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Last\_Coin\_Games](https://forums.unrealengine.com/u/Last_Coin_Games)\
**Post date:** [January 24, 2021, 12:13am UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/369 "2021-01-24T00:13:01Z")

</div>

hi @rotacak  
Can you remove collision keyword in hidecategories meta in FGearCustomCollision.h line:9 and recompile. if your project is only blueprint, Add static mesh component to your vehicle class. Set **mass scale** to 0 in staticmeshcomponent for not effect to inertia.  
pls let me know if any problem

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 25, 2021, 8:36pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/370 "2021-01-25T20:36:01Z")

</div>

**[lazybitgames](https://forums.unrealengine.com/member/324677-lazybitgames):** Thanks, I solved it now. But I have another problem, when I will remove all gear ratios and use SetGearRatio (from the blueprints), then it will crash. Is there a way how I can add the gear ratios?

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 25, 2021, 8:44pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/371 "2021-01-25T20:44:28Z")

</div>

> [@rotacak](#):
>
> But I have another problem, when I will remove all gear ratios and use SetGearRatio (from the blueprints), then it will crash. Is there a way how I can add the gear ratios?

if you remove all ratios then you will be accessing an empty array, first call setGearCount to resize the array and then you can call setGearRatio.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 25, 2021, 9:06pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/372 "2021-01-25T21:06:45Z")

</div>

> [@lazybitgames](#):
>
> if you remove all ratios then you will be accessing an empty array, first call setGearCount to resize the array and then you can call setGearRatio.

I tried that but it will crash anyway with same crash message ☹

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 25, 2021, 9:33pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/373 "2021-01-25T21:33:11Z")

</div>

> [@rotacak](#):
>
> I tried that but it will crash anyway with same crash message ☹

the bp code in the image works fine.

but i found a problem not related to the crash, we used array.reserve instead of array.resize so it’s not possible to shrink the array size at the moment.  
if you are using c++ it’s a single line fix but not possible with BPs. if you need a fix for this(not the crash), drop me a mail.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 25, 2021, 9:56pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/374 "2021-01-25T21:56:09Z")

</div>

\*\*[lazybitgames](https://forums.unrealengine.com/member/324677-lazybitgames): \*\*Wait, how that your bp code could work? Only in case that you did not deleted all gears, right? Will it be fixed in next version?

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 25, 2021, 10:11pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/375 "2021-01-25T22:11:04Z")

</div>

> [@rotacak](#):
>
> \*\*[lazybitgames](https://forums.unrealengine.com/member/324677-lazybitgames): \*\*Wait, how that your bp code could work? Only in case that you did not deleted all gears, right? Will it be fixed in next version?

my code works normally the only problem is that you can increase gear count but can’t decrease it.  
it will be fixed in the next release but as i said i can provide a fixed build for you.

BUT this fix is not the solution to your crash, you must be doing something wrong, call setGearCount and don’t forget that if you need 6 gear transmission you need a size of 7, an extra to be used for rear gear ratio.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 25, 2021, 10:52pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/376 "2021-01-25T22:52:34Z")

</div>

> [@lazybitgames](#):
>
> my code works normally the only problem is that you can increase gear count but can’t decrease it.  
> it will be fixed in the next release but as i said i can provide a fixed build for you.
> 
> BUT this fix is not the solution to your crash, you must be doing something wrong, call setGearCount and don’t forget that if you need 6 gear transmission you need a size of 7, an extra to be used for rear gear ratio.

I am doing this:

1. open fgear example
2. open truck BP
3. delete all gear ratios
4. in begin play do SetGearCount() to 10
5. after that do SetGearRatio() for gear 0 to ratio 0.5 for example
6. crash

This does not crash for you?

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 25, 2021, 11:21pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/377 "2021-01-25T23:21:58Z")

</div>

> [@rotacak](#):
>
> I am doing this:
> 
> 1. open fgear example
> 2. open truck BP
> 3. delete all gear ratios
> 4. in begin play do SetGearCount() to 10
> 5. after that do SetGearRatio() for gear 0 to ratio 0.5 for example
> 6. crash
> 
> This does not crash for you?

did the same with the BP in the image, no crash.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 26, 2021, 11:05am UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/378 "2021-01-26T11:05:37Z")

</div>

Hmm, weird. Look (UE 4.25.3):

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/a/dea4b598f9024da4fdff03fb88a36a9f0833837e.jpeg "fgear crash") ](https://www.youtube.com/watch?v=8uwmjV1tvQo)

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 26, 2021, 12:55pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/379 "2021-01-26T12:55:19Z")

</div>

@rotacak can you try this:

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 26, 2021, 2:10pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/380 "2021-01-26T14:10:29Z")

</div>

> [@lazybitgames](#):
>
> @rotacak can you try this:

I tried it and did only SetGearRatio() for gear 0. No crash.  
Then added SetGearRatio() for gear 1. No crash.  
Then added SetGearRatio() for gear 2 and it crashed again.

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 26, 2021, 3:00pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/381 "2021-01-26T15:00:04Z")

</div>

> [@rotacak](#):
>
> I tried it and did only SetGearRatio() for gear 0. No crash.  
> Then added SetGearRatio() for gear 1. No crash.  
> Then added SetGearRatio() for gear 2 and it crashed again.

allright fixed it, drop me a mail, i will upload a fixed build(4.25) for you.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 29, 2021, 2:59pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/382 "2021-01-29T14:59:39Z")

</div>

Hello, I have another complication, that was already discussed here. How to properly stop the car? There seems is no way how to hold hand brake from the blueprints (not by pressing the keys) when the fgear standard input is enabled. Or it is possible? Because only that is probably the only way, how to really stop the car (+ used Sticky Tire Max Speed).

If I will not use the hand brake, but only increase Rolling Resistance Coeficient to absurd number then the wheels are stopped but the car is still slowly sliding away. Even on a very small slope. If I will use also Sticky Tire Max Speed option then it will slide slower but still not stop completely.

So question is: is possible to somewhat simulate pressing handbrake from the blueprints when the fgear standard input is enabled? Or will be?

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/a/b6a76071aad8bc9cf344a1d725ea341e7b8c4f5d.jpeg "fgear sliding stopped car") ](https://www.youtube.com/watch?v=vsVCJ-xCdiA)

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 29, 2021, 3:04pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/383 "2021-01-29T15:04:39Z")

</div>

> [@rotacak](#):
>
> How to properly stop the car?

did you try the EnterExit map? get in the car and get out on a slope, the handbrake is turned on and sticky tires handle the rest.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 29, 2021, 4:47pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/384 "2021-01-29T16:47:02Z")

</div>

> [@lazybitgames](#):
>
> did you try the EnterExit map? get in the car and get out on a slope, the handbrake is turned on and sticky tires handle the rest.

Hmm, there it works. Probably because SetBraking() is called from the level blueprint. But if I will use EventTick-\>SetBraking() in the car BP then it not brake at all. Should it work there too?

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [January 29, 2021, 5:29pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/385 "2021-01-29T17:29:16Z")

</div>

It works when I will turn off standard input, but I need to have it on.

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [January 29, 2021, 5:44pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/386 "2021-01-29T17:44:06Z")

</div>

> [@rotacak](#):
>
> Hmm, there it works. Probably because SetBraking() is called from the level blueprint. But if I will use EventTick-\>SetBraking() in the car BP then it not brake at all. Should it work there too?

it won’t work in vehicle BP, standard input will overwrite the values.  
first pawn tick is called then we do our own updates so the BP tick is called before internal updates.  
we might add a post tick event for the next release and i’ll let you know if i find a workaround.

---

<div class="post-metadata">

**Author:** ![rotacak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rotacak/32/442224_2.png) [@rotacak](https://forums.unrealengine.com/u/rotacak)\
**Post date:** [February 3, 2021, 5:27pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/387 "2021-02-03T17:27:28Z")

</div>

BTW, it looks like the extras pdf is outdated. Cannot find anything about FGearSuspensionConstraint there ([Dropbox - fgue4docs.rar - Simplify your life](https://www.dropbox.com/s/o8fdgsiezfaf20h/fgue4docs.rar)).

---

<div class="post-metadata">

**Author:** ![lazybitgames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lazybitgames](https://forums.unrealengine.com/u/lazybitgames)\
**Post date:** [February 3, 2021, 5:34pm UTC](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793/388 "2021-02-03T17:34:31Z")

</div>

> [@rotacak](#):
>
> BTW, it looks like the extras pdf is outdated. Cannot find anything about FGearSuspensionConstraint there ([Dropbox - fgue4docs.rar - Simplify your life](https://www.dropbox.com/s/o8fdgsiezfaf20h/fgue4docs.rar)).

yes, thanks for the feedback.

Suspension constraint can be used to prevent tire/ground or tire/vehicle penetrations. This adds a joint component for each wheel at start and then updates their parameters in real time so that the vehicle body stays in an acceptable transform.

[Previous page](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793.md?page=18)

[Next page](https://forums.unrealengine.com/t/fgear-vehicle-physics-v1-4/128793.md?page=20)
