FGear Vehicle Physics (v1.4)

I thought it might be because UE was open but I’ve tried it with ue open and closed.
Quick question when I hopefully finish my game, would my gamer’s have to go through this same process?

@lazybitgames is the enhanced input ( new input system) supported? If not can you update the plugin to support it since the old/traditional one is deprecated ? I tried to do it but got stuck, if you are going to do it here is what I have so far ( to help you save time) :

UENUM(BlueprintType)
enum class EInputSystemType : uint8
{
Traditional UMETA(DisplayName = “Traditional”),
Enhanced UMETA(DisplayName = “Enhanced Input”)
};

private:
/** New property to select the input system. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”)
EInputSystemType InputSystemType;
/
* If unchecked user inputs will not have any effect. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Enabled”)
bool mEnabled;
/
* This applies only to throttle, brake and steering controls. If you want to use a combined axis like Vertical Axis for throttle/brake controls and Horizontal Axis for steering then enable this. If you want to use seperate axis for those then uncheck this option and setup proper axis values. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Use Combined Axis”, meta = (EditCondition = “mEnabled”))
bool mCombinedAxis;
/
* Type of the controller : Keyboard, joystick or wheel. Most of the controls can work at the same time, for ex. even if you select keyboard you can play with joystick too. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Controller Type”, meta = (EditCondition = “mEnabled”))
FGearControllerType mControllerType;
/
* Type of the shifter : Auto, sequential or manual. If the AutoChange option of the transmission is checked this selection has no effect but if you want to manually change gears then you can choose a sequential mode or full manual mode. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shifter Type”, meta = (EditCondition = “mEnabled”))
FGearShifterType mShifterType;
/
* This is a combined axis for throttle and brakes and only available if you check UseCombinedAxis option. Range : [-1, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Vertical Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mVerticalAxis;
/
* This is the steering axis name and this is only available if you check UseCombinedAxis option. Range : [-1, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Horizontal Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mHorizontalAxis;
/
* If you uncheck UseCombinedAxis option you can assign an axis for throttle with this. Range : [0, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Throttle Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mThrottleAxis;
/
* If you uncheck UseCombinedAxis option you can assign an axis for braking with this. Range : [0, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Brake Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mBrakeAxis;
/
* If you uncheck UseCombinedAxis option you can assign an axis for left steering with this. Range : [0, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Left Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mLeftAxis;
/
* If you uncheck UseCombinedAxis option you can assign an axis for right steering with this. Range : [0, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Right Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mRightAxis;
/
* Clutch axis for manual transmission. Range : [-1, 1] but internally normalized to [0,1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Clutch Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mClutchAxis;
/
* Handbrake input axis. Range : [0, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Handbrake Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mHandbrakeAxis;
/
* This is a combined axis for gear up and gear down. Range : [-1, 1]. /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShiftAxis;
/
* Axis for first gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 1 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift1Axis;
/
* Axis for second gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 2 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift2Axis;
/
* Axis for third gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 3 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift3Axis;
/
* Axis for fourth gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 4 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift4Axis;
/
* Axis for fifth gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 5 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift5Axis;
/
* Axis for sixth gear. Range : [0, 1] /
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift 6 Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShift6Axis;
/
* Axis for reverse. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = “FGearStandardInput”, DisplayName = “Shift R Axis”, meta = (EditCondition = “mEnabled && InputSystemType == EInputSystemType::Traditional”))
FName mShiftRAxis;

// Enhanced Input System Properties for Action Mappings

/** This is a combined axis for throttle and brakes and only available if you check UseCombinedAxis option. Range : [-1, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Vertical Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mVerticalActionMapping;
/** This is the steering axis name and this is only available if you check UseCombinedAxis option. Range : [-1, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Horizontal Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mHorizontalActionMapping;
/** If you uncheck UseCombinedAxis option you can assign an axis for throttle with this. Range : [0, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Throttle Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mThrottleActionMapping;
/** If you uncheck UseCombinedAxis option you can assign an axis for braking with this. Range : [0, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Brake Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mBrakeActionMapping;
/** If you uncheck UseCombinedAxis option you can assign an axis for left steering with this. Range : [0, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Left Steering Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mLeftSteeringActionMapping;
/** If you uncheck UseCombinedAxis option you can assign an axis for right steering with this. Range : [0, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Right Steering Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mRightSteeringActionMapping;
/** Clutch axis for manual transmission. Range : [-1, 1] but internally normalized to [0,1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Clutch Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mClutchActionMapping;
/** Handbrake input axis. Range : [0, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Handbrake Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mHandbrakeActionMapping;
/** This is a combined axis for gear up and gear down. Range : [-1, 1]. */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShiftActionMapping;
/** Axis for first gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 1 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift1ActionMapping;
/** Axis for second gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 2 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift2ActionMapping;
/** Axis for third gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 3 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift3ActionMapping;
/** Axis for fourth gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 4 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift4ActionMapping;
/** Axis for fifth gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 5 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift5ActionMapping;
/** Axis for sixth gear. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift 6 Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShift6ActionMapping;
/** Axis for reverse. Range : [0, 1] */
UPROPERTY(EditAnywhere, Category = "FGearStandardInput", DisplayName = "Shift Reverse Action Mapping", meta = (EditCondition = "mEnabled && InputSystemType == EInputSystemType::Enhanced"))
FInputActionKeyMapping mShiftReverseActionMapping;

I did that already before that errors. Cannot make to work the example project in any way. Only in 4.27.

Can you confirm that on component hit works in 5.3 or it is bug?

Finally I make it work (the example project in 5.3) with some mystery.

But the “on component hit” on fgear custom collision is not fired even in example project. I checked “generate hit events” and nothing. In 4.27 it is ok.
I will choose first car and crashing to other cars and event will not fire.

did you try rebuilding with visual studio…

make sure both the custom collider component and your physics asset have “generate hit events” setting checked.

thanks for sharing, this is on our todo list.

That is! Thanks! (btw, can’t open example project again :frowning: )

What no, I’m a newbie no idea about visual studio or coding

you don’t need to know coding but at least learn how to build a project.

1 Like

All due respect I thought I’d try the example project, which had some issues but the solutions you gave, I followed. It still doesn’t open for me.
I have never used visual basic basic and when I bought the plugin I had no idea I have have to use it.
Plus i don’t understand why i can’t open it in 4.7 either
Can you provide any solution for me please?

redownload the example project, it might be an older version, it’s been modified multiple times this month.

extract and try to open with 4.27, if it fails go to Saved/Logs folder and send FGear.log file to lazybitgames@gmail.com

1 Like

Hello! First of all thanks for this wonderful asset.
I have a simple question : would it be possible to add a physical turbocharger?

forced induction is not a currently planned feature(it is in the list but low priority) but it should be quite simple to implement a simple turbo with blueprints.


So I tried that and got this error. I’ll try again after I dload .net
My question is if my gamers haven’t got .net installed on their computer would they have to go through this process too?

no not like this but it is developers duty to automatically install prerequisites and I believe unreal has an option to add its prerequisite installer to the game package…

After installing .net version 8 I’m getting the same error about .net.
I have visual studio v17.8.3
Is there anything I’m omitting?

I would make a fresh install and follow this guideline : Setting Up Visual Studio 2022 for Unreal Engine 5 | Community tutorial

So to be clear only re-install visual studio?

I did a scripted test, first run is zero ABS and the second run is %100 ABS.
the green line shows where we ended up in the first run.

it looks like an expected behavior to me but that doesn’t mean the behavior is the same as the previous version.
we’ve modified some fundamental parts of the wheel code so some change is expected but if you see any unrealistic response let us know.

note: the red car is tuned a bit differently for this test.