Vehicle Parts - Attaching Spinning Motors

Hi.

I’m trying to figure out how to start implementing a system where I can add components to an vehicle.

Currently, I have an Actor that has 4 PhysicsConstraints each with a ChildActor that is my motor.

And the Motor’s Tick is a simple rotation.

Currently, what happens is the wheels seem to rotate, but they just slide across the ground away from the cube/frame.

What I’m hoping to accomplish is to understand how to create a Motor with a mesh/socket, and be able to attach different wheels onto that motor ( sizes, shapes, etc ), and then have it work as expected.

Thanks for your help.

I solved my issue ( for the most part ) by following a tutorial I found on YouTube. I thought I would share the source and what I’ve done with his solution to solve this problem.

Custom Vehicles in Unreal Engine 4 - 1 - Physics Constraints for Rolling Wheels and Hitches


One of the main things was I wasn’t using Constraints correctly. You don’t just nest them, you have to specify the Component Names for both, and then it’ll show what is contrainted.

I also added an arrow to get the normal of the vehicle, and a wheel on top to test applying the torque, as I noticed just applying it would often apply it incorrectly ( such as applying it backwards if the vehicle turned around ).

Constraints

Move Forward
Here is the overall flow. From taking the user-input, then getting the torque, and applying it.

Get Normal
Finding the direction of the vehicle by referencing the arrow, and rotating it 90.

Get Torque
TorqueMod is just a float, currently at 100.

Add Torque
And finally adding the calculated torque to the wheel.

Known Issues:

Currently, the weight of the vehicle is very off. The test tire will be spinning insanely fast, but the vehicle will barely move. I still have no idea how to fix that. And needing to use ‘Accel Change’ with AddTorque so it ignores the weight. Otherwise it won’t move at all.

If you have any ideas on how to solve that, please send me a message. Thanks!