I hope you can give me ideas that help resolve my problem.
I have set up a buggy car wherein I need the axle to move in accordance with the wheels. I’ve set up the script already for that but my problem is how can I let some other vertical bars to follow as the wheels are suspending? Please take a look at the screenshot for you to visualize.
What should be the most effective way in doing so, I’m quite new to Unity but I’m willing to learn some exciting stuffs, should I used IK/FK or it can be done only by a simple thing which I don’t know??
An easy way to do this would be to have the axle’s anchor point at the end attached to the car body with the Z axis pointing along the length of the axle. Then, you would simply need to rotate the axle each frame to point toward the wheel (you could use transform.LookAt to do this). For this to look exactly right, the wheel should move inward slightly as it moves down (or else you should fudge the graphics slightly to cover this up ).
I think he has the axle bit sorted out its the dampers he needs working, but the answer is the same Smile quick way is to use a LookAt and a scaling along the centre axis of the shocks.
Thanks for response… Indeed SpookyCat is right, I already managed to set up the axles movement to look at the center and the other end will follow on the wheels position.
I’ve already done with the axles through lookat function and following the position of the wheels but I can’t get right with the spring damper visualization.
If you have a pivot point at one end of your connecting object you can just have that positioned on the chassis as a child, then do a lookat to the point you want to attach it to on the moving part of the suspension, then you scale your connecting object on the y axis in your case by a ratio of the distance between the two points you are connecting and the size of the object (in the y axis) that you are connecting them with.