Unity excavator joint linkage

I was interviewed by a company and asked me to do a programming question. I thought it was quite simple at first, but later I found that the physical effect was not perfect, and I didn’t have a good idea for coding myself, because the main thing is A linkage. Later, I referred to the post of a certain master and finally achieved the effect. See the effect in the picture.

 

The title content: (Equipment operation control logic implementation)

Requirement: Realize the excavator's excavation operation according to the provided information, and the input method is keyboard mapping.

Content includes:

(1) The excavator can be operated to rotate the cockpit left and right. Map the two keys "Z" and "X" on the keyboard.

(2) The main arm (big arm) of the excavator can be operated to rotate longitudinally along the arm root and map the two key positions "C" and "V" on the keyboard.

(3) The operable sub-arm (small arm) rotates longitudinally along the arm root to map the two key positions "B" and "N" on the keyboard.

(4) The bucket can be operated to flip in the axial direction and map the two keys "G" and "H" on the keyboard.

(5) The bucket can support the body by supporting the ground with its big arm and small arm.

(6) The left and right crawler tracks of the excavator can be controlled independently. The forward and backward movement of the left crawler track can be controlled through "Q" and "A", and the forward and backward movement of the right crawler track can be controlled through "W" and "S". A""W" compound operation can realize the in-situ driving steering function. The dynamic effects of the tracks do not need to be displayed.

(7) The hydraulic rod moves together with the movement of the equipment.

(8) Observe the vehicle from a third-person perspective.

 

 

Project and resource download link: (5C coins)

https://download.csdn.net/download/qq_18427785/12446990

Guess you like

Origin blog.csdn.net/qq_18427785/article/details/106281182
Recommended