Where would I need to look to find the syntax for other wheel properties?
i.e. I want to be able to change properties in the Wheel Class such as Radius or Suspension Raise / Drop etc. or just swap the entire Wheel Class.
This thread is the most promising I found, but I have no idea how to go about any of it.
If you use Visua Studio just click Ctrl+Space after “->” and select need parameter.
If need, here is the list of Wheel properties and functions to use:
My car starts colliding with itself and just goes ballistic.
Edit: As for Code Suggestion/Ctrl+Space (“Intellisense” I guess) - I now ran “Generate VS Project Files” (rightclick on UE4 project file) and that part works finally (it compiled before, but not having code suggestion was just horrible).
Where do you use wheels recreating, and one additional moment when you use RecreatePhysicsState is recreates physics state, and the engine recallect all physics data and make new physcs state, as a result your car will lose all current physics force.
There only some parameters of car that you can change in realtime: EngineSetup, DifferentialSetup, TransmissionSetup, DragCoeficcient, mass, InertiaTensorScale, AckermannAccuracy, SteeringCurve and TorqueCurve, Inputs, DragArea
Speaking about wheels you could only change the frictionscale:
only some parameters of car that you
can change in realtime […]. Speaking about wheels you could only change the frictionscale
I’m not sure I understand. Are you saying that most of the parameters you posted before (such as ShapeRadius; ShapeWidth etc.) can’t be modified at all in realtime?
I am executing RecreatePhysicsState in the ABuggyPawn (a child of AWheeledVehicle class) inside an event triggered in the vehicle blueprint on key input (event is empty otherwise).
when you use RecreatePhysicsState is
recreates physics state, […] your
car will lose all current physics
force.
On execution (with or without change to any wheel parameters in the event), the car starts to jitter, shake and continuously gets bounced in the air (accompanied by collision sounds set up in the VehicleGame). It is a similar result to a car (or any other skeletal mesh) with auto-generated PhAT bodies.
Is the first being the current value and the second the configuration value applied on actor spawn. Changing the first doesn’t do anything, while changing the other actually changes the data asset, as well as does this line:
Wheels[0]->TireType->SetFrictionScale(1);
Frictionscale applies immediately at runtime, without the need to call recreate physics or setupVehicle() or anything, while ShapeRadius only applies after respawning the actor.
The problem though, as mentioned before: those changes apply to the actual data asset (if I go back to the editor, the data blueprints actually have changed). It’s interesting, but not very useable, as it changes the actual config and not an instance of it.
Is there a documentation on this or some examples in general? Feel really lost on this.
Edit:
For now, as my prototype works with a single vehicle setup, I have a WheelData + TireType asset for each wheel and one custom DataTable with default configuration values. On BeginPlay the data from the DataTable is being applied to the MovementComponent and thus saved in the WheelData/TireType assets which I treat as runtime storage. For shape I unfortunately have to destroy and respawn the actor once.
In the end I am able to have each wheel use different friction, mass and radius.
I guess if I wanted it to work with multiple vehicles, I’d have to dynamically allocate the WheelData/TireType.
Unfortunately with this setup I can only change wheel shape in a Garage Style environment, and wouldn’t be able to simulate for example a flat or lost tire while driving.
Yeap, you have right, unfortunately there is no documentation about this, and we have to look into this by ourselves.
Also, you could to look around SetupVehicle(), but it doesn`t work as needed. It also recreate your car and clear all its forces, but do not creat it after clearing.
Hey everyone, I know this is an old thread, but I’m looking to change the wheels’ suspension damping rate. Was there a definitive answer to change these settings at runtime?