- Home /
How can I rotate and move a cylindrical rod from one side with respect to other side?
HI, I have 3 questions here. If answer of 2nd question is yes, then i dont need answer for 1st question.
I want to rotate one end of this rod and when i rotate 2nd end. i want it to move parallel to 1st end. Right now when i rotate right end in upper direction, left end goes in lower direction and pivot remains at its position. When rod is in straight line, one end will simply rotate and when rod is already tilted, it will move one end in line with the other end.
Can i simple move one end of rod? instead of rotating it just simply move one end of rod upwards and not the entire rod?
when i use gravity on the ball it falls on the rod and take the rod down with it. if i make rod kinemetic, it wont move or rotate. i want ball to use gravity but not to drag rod with itself.
Answer by cs120319992 · Jan 18, 2019 at 02:13 PM
Your question is not clear But, from image I realized
private void Update() {
// He will stand in one place
rod.transform.position = Vector3.zero;
// Or allow chande only on x axe
rod.transform.position = new Vector3(rod.transform.position.x, 0, 0);
// If is 2D, set pivot to center and freeze position
}