[Closed] Help with attachment script
I am in a little bit of a fix which I hope you guys can help me with.
I have some suspension setup (shown in the attached images). This is relativly simple. Pivot A is parented to the body. The main suspension strut (green) is parented to it. Pivot A has a look at controller that looks at pivot B. Pivot B is then parented to Pivot C. When pivot C is raised and lowered the suspension arm controlled by A and B moves. This all works perfectly(ish).
However as you can see the wheel should not ba able to raise verticaly it should actualy be restrained to the curved path the suspension arm takes. This isnt happening as the look at controller does not maintain a distance to the lookat target. This means that pivot B can slide and this allows the wheel to raise and lower. What I need to do is to constrain the wheels upward motion to the arc made by the suspension arm.
I though the easiest way woud be to make a script controller to restrain pivot B to the end of the suspension arm. Are alteranativly to force the wheels motion path to mimic this arc.
Any help would be great.
PS I have to do this for 7 other wheels as well
File is attached. Just use POINT_Master_WheelRoad_Right_01 to manipulate the wheel.
Thanks
Harry
Hey,
So the wheel is FIXED to the end of SuspensionArm_Right_05 and SuspensionArm_Right_05 is supposed to rotate as if it was being pushed by the wheel? If that’s teh case, you probably don’t need scripting, just to change the linkage order.
Is this for a game or an animation… ie, how realistic does it need to be?
Hi Dave
No the wheel is the child of POINT_Master_WheelRoad_Right_01. When this point is moved the wheel moves. In effect the control needs to be at the wheel. The suspension mimics the wheel. This way I can place the wheel on the ground and the suspension can follow. What I need to do is constrain the motion of the wheel to the arc motion of the suspension. I have tried to illustrate this in the attached image.
The blue arrow shows the current path and as you can see this should be an arc but is in fact a straight line. The red path shows the correct path as should be determined by the suspension travel.
The suspension is for a simulation so has to be relatively realistic. Otherwise I would have tried to get away with what I have
Thanks
Harry