Lifting Object with Forklift - Parenting Logic

Hey everyone!

I’m pretty new to Unity and I’m coming from an engineering angle with the goal of creating virtual environments for engineering simulations.

As a first project I would like to simulate a forklift that picks up objects (e.g. a pallet). For my purposes (and in order to avoid all the weird issues with physics and pallets bouncing around) it seems like the easiest way would be to just child the pallet to the forks when the forks are “lifting it up”, and unchild it when it’s “set down”.

However, I’m a bit stuck on how to integrate such a logic - if anyone has a good idea on how to detect that the forks are in the right place and trigger the childing/unchilding that would be really helpful, thanks a lot!

Well, off the top of the head, using a Vector3.Dot(), and Vector3.Angle is probably in your interests. Basically you just need to ensure the pallet if in front of you , within such an angle. Seems like it shouldnt be too hard with a little toying.