FGear Vehicle Physics (v1.4)

@KiwiArgo
You can change the position of the bones by moving them back and forth, left and right. (you will need to add the incoming position data to the offset in order not to disturb the suspension)
You will also need to re-invoke certain routines after changing the bone position.

@lazybitgames hello! I bought this product and itā€™s amazing, but what happens is that when I import my own car, it starts to smoke a lot and when Iā€™m applying the handbrake it makes it very unrealistic, that is, all the driving is unrealistic, I took a copy of the sandbox and I put my custom mesh and all the handling is strange, nothing similar to the examples, I heard in the document that if you donā€™t rig the car well you will have problems, is that what you mean? I just canā€™t find a 3ds max tutorial on rigging these cars, if anyone has an answer Iā€™ll be grateful.

Maybe should make it clear whether you are running on UE4 or UE5?

i will create a 4 wheels bone template and post here.

1 Like

Somebody here integrated any kind of burnout system? Can somebody share the code or give any tips of how it should be?

I started with some idea that is something but far to be as good as needed:

	  if ( speedUI < 25.0f && mWheelTorque > 0.0f && mAccel > 0.0f ) 
	   { 
	   // START VALUE   || 0 Mass Wheel
	   mMass = FMath::Lerp(0.0f, 
	   
	   // DESIRED VALUE || From 0 to default car Mass Wheel
	   mMassDefault, 
	   
	   // SPEED VALUE   ||  The lerp speed sets the final value
	   FMath::Clamp( speedUI * 0.04f , 0.01f, 0.99f) ); 
	   }
	   
	  else  { mMass = FMath::Lerp(mMass, mMassDefault, 0.01f); } 

Basically when car speed is less than 25km/h, the mass goes from 0 to default based on that speed. It makes that on car stop and accel or when doing 180Āŗ turns, the wheels on that speed range got lot of spin giving a good feel but have also some cons too.

So before develop or try other ideas, wonder if somebody already did it and what values or how it was achieved.

I have attached fbx and 3dsmax files for bone orientation. Dont move root bone from origin (0,0,0)
Fgear_Bones.FBX (15.8 KB)
Fgear_Bones.max (764 KB)

1 Like

Any ETA Oon 5.1 compatibility?

before 2023 :slight_smile:

8 Likes

Hey thanks.
I tried moving the bones using IK but it seems like the IK executes after or out of sync with the vehicle physics, so only the visuals really update.
I need to move them in runtime (Iā€™m building a car configuration basically, where users can set the wheel position for different cars). Do you think if thatā€™s possible?
Also, which routines you think I should invoke?
Thanks!

Add an extra vector to change the wheel offset. mRimOffset can sample for you. Please review mRimOffset and functions in UFGearWheel component

I was able to do that in the animation BP. I donā€™t know if itā€™s the best way to do it. Just like this video Chaos Vehicles Wheel Shift and Camber - Unreal Engine 5 Tutorial - YouTube.

@lazybitgames This is what happens when I put a custom vehicle model on it, there is the correct bone adjustment, also despite the fact that the bp animation is not there, the same if I put it on, this error continues, I donā€™t know what to do anymore, I checked the physics asset and why What I see is the same, also the names of bones, any solution? I would thank that very much *im using unreal engine 5.0
Error

Iā€™ll take a swing here. But it looks like you have a collision primitive on the wheels in the physics asset. The PA for Fgear utilizes just one component for the root or car body unlike chaos that uses primitives for the wheels as well. Take out the sphere primitives on your wheel and try again.

This is my physics asset

Hi! I have a crash on Android in random moment

2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #00 pc 0d327f18 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FPhysicsCommand_PhysX::ExecuteRead(FPhysicsActorHandle_PhysX const&, TFunctionRef<void (FPhysicsActorHandle_PhysX const&)>)+28) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #01 pc 0d2a983c /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FBodyInstance::GetUnrealWorldAngularVelocityInRadians() const+100) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #02 pc 075259d0 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (AFGearVehicle::substepTick(float)+472) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #03 pc 07532d70 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (AFGearVehicle::Tick(float)+164) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #04 pc 0c69cb30 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (AActor::TickActor(float, ELevelTick, FActorTickFunction&)+324) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.887 27252-27252/? A/DEBUG: #05 pc 0c697ee0 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FActorTickFunction::ExecuteTick(float, ELevelTick, ENamedThreads::Type, TRefCountPtr const&)+944) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #06 pc 0d803a84 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FTickFunctionTask::DoTask(ENamedThreads::Type, TRefCountPtr const&)+556) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #07 pc 0d803268 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (_ZN10TGraphTaskI17FTickFunctionTaskE11ExecuteTaskER6TArrayIP14FBaseGraphTask22TSizedDefaultAllocatorILi32EEEN13ENamedThreads4TypeE+852) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #08 pc 08ac24c8 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FNamedTaskThread::ProcessTasksNamedThread(int, bool)+2372) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #09 pc 08ac083c /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FNamedTaskThread::ProcessTasksUntilQuit(int)+188) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #10 pc 08abd7b4 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (_ZN24FTaskGraphImplementation22WaitUntilTasksCompleteERK6TArrayI12TRefCountPtrI11FGraphEventE16TInlineAllocatorILj4E22TSizedDefaultAllocatorILi32EEEEN13ENamedThreads4TypeE+1212) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #11 pc 0d7fb510 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FTickTaskSequencer::ReleaseTickGroup(ETickingGroup, bool)+2808) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #12 pc 0d7f5658 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FTickTaskManager::RunTickGroup(ETickingGroup, bool)+100) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #13 pc 0cf01370 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (UWorld::Tick(ELevelTick, float)+11220) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #14 pc 0ccea500 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (UGameEngine::Tick(float, bool)+4580) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #15 pc 06fc004c /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (FEngineLoop::Tick()+29340) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #16 pc 06fb6f24 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (AndroidMain(android_app*)+3992) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #17 pc 06fca358 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (android_main+176) (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #18 pc 07000914 /data/app/com.cybergaming.blockwarriorsde-OZacn5O9AV3EjMD2EsYGYQ==/lib/arm/libUE4.so (BuildId: 573bb05c2db00ede8bea188a38a3cac1ab832ac0)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #19 pc 000a75b3 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: 51d80220c9e0c42255369657a8641799)
2022-12-21 01:08:07.888 27252-27252/? A/DEBUG: #20 pc 00061b33 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: 51d80220c9e0c42255369657a8641799)

drop a mail, post a screenshot/gif with telemetry gizmos on and attach your vehicle json file too.

Sorry, how is this json file made? I donā€™t see it in my car files.

You can save/load vehicle settings here :slight_smile:

1 Like

Can this be used out-of-the-box with World Partition in UE5? Iā€™m struggling to get it working, i.e.: When Iā€™m driving a few hundred meters, all the sudden camera getā€™s reset to some point in the map and I lose control of my vehicleā€¦

Issue after driving a few hundred metersā€¦ No issues on the sandbox map (driving even further)

See video of the issue:

In case someone is running into the same issue, I was able to solve this issue by unchecking the ā€˜is spatially loadedā€™ from the BP_Vehicle:

image

Ps. When I spawn a regular pawn (not my character that will go inside the vehicle, this issue does not occurā€¦ :slight_smile:

1 Like