I need to simulate a piston for a forklift, but I don’t really know how to create an accurate physics model
The forklift ( a car with some wheel colliders ) should react to the force applied by cargo on the forks, but the forks should also move along the lift axis and sideways while colliding with cargo and the environment, and the forklift should react to the changes, if the forks hit a wall, the forklift should react accordingly, and if the forks hit the floor or a ceiling, it should lift itself or push itself away
Right now I only have a lift that moves the cargo accordingly with credible friction and also reacts to the velocity of the forklift but if I hit the forks against walls or other static colliders, the forks just go through and the forklift doesn’t react at all
How did you managed to achieve what you already have?
I’m just using a script with Unity that syncs the collider of the forks each physics frame, aka FixedUpdate, the collider is sync with a transform anchor, an empty GameObject that represents the point where the forks should be, this ensures that the physics update occurs in the time it takes from Update (When the animation component syncs) to FixedUpdate(When the collision component syncs)
The obvious issue with this is that I’m just syncing a collider with a transform so it won’t react to any type of force. I’m just moving the object, not applying any directional force so any counterforce will be ignored (No slowdown because of the weight of cargo)