- Home /
Forklift pallet physics
Hello,
What I have:
Forklift with a rigidbody and appropriate colliders
Forks that move through an animator with simulated physics on. The forks themselves have box colliders
Pallet with rigidbody and colliders
Physics materials
List item
Wood: dynamic: 0.8, static: 0.8, bouncy: 0 Metal: dynamic: 0.6, static: 0.6, bouncy: 0 - The forklift movement - List item
What the problem is: I can pick up the pallet just fine, but when I tilt my forks back. The pallet doesn't follow along as shown in the gif below. I have been trying to find an answer to this, but no luck so far. How do I go about fixing this issue?
EDIT: For those who would like to mess around in a project, I created a unity package which contains a dummy version of everything. Import the package, open the test scene and run it. Controls: arrow keys to move, L to move forks up, SHIFT + L to move forks down, M to tilt the forks, SHIFT + M to tilt in opposite direction.
Answer by Mr_Teels · Jan 10, 2020 at 04:56 PM
Try adding a "Physics Material" to the Palett and the BoxCollider. The standart PhysicsMaterial hat little to no friction...
Both have a physics material with frictions set to 1 (or higher), still sliding.
Answer by lgarczyn · Jan 12, 2020 at 02:07 PM
An animator with animate physics is only supposed to be used on kinematic objects. I'm surprised how well this works, but this might be the cause
I would recommend using a Joint to represent the forklift tilt and another for the elevator, and either script or animate the joint values.
Damn, it should work then. Are you sure the forklift hotbox is not pushing against the pallet?
I am sure yea. I uploaded a small package with the forklift recreated incase you want to experience it for yourself.
Answer by Bunny83 · Jan 12, 2020 at 03:46 PM
Does your sliding "fork" gameobject has it's own rigidbody? If not you're violating basic rigidbody principles. If you lift and tilt that fork inside a single rigidbody object, it's no longer a rigid object.
Also make sure the physics material of your fork and your pallet colliders have a high friction value. Keep in mind that the frictionCombine value controls what actual friction value will be used. See PhysicMaterialCombine for more information.
If I add a rigidbody to the parent object of both forks or a separate rigidbody to each fork, it then acts weird too. But I ill try make a simplified forklift first, the model i received is kinda big and bad. I will get back to you when I have done this.