i have a object as a cylinder and other object rectangle placed above the cylinder.Now i want to move the rectangle half around that cylinder...i mean not 360 degree but 90 degree to one side and 90 degree to other.. is that possible...If yes then how?
If I get this correctly, what you want to do is move a rectangle to both sides of a cylinder between 90 and -90 degrees. Fro this you can either use a RotateAround(CYLINDER) or you can child the rectangle to the cylinder and rotate the cylinder.
Actually the pink end is placed on the cylinder and i want to move this backwards and forward but as rotation around the cylinder only half of complete 360 degree ...half on side and half on other side...as a door that open to both in and outside
Than make a pivot point (parent with just a transform) on the corner of the door you wanna use to rotate around it and rotate that as a parent to the door object. Either that or use a https://docs.unity3d.com/Manual/class-HingeJoint.html
Maybe this can help: https://docs.unity3d.com/ScriptReference/Transform.RotateAround.html U simply define point in space and axis through that point also an angle and that is it. In this ^^^function all parameters(point and axis are in world coordinates) With transform.transformPoint and transform.transformDirection u can transform from local to world system points and axis.
I want my object position not changed but it only rotate as the door is at same position but only opens in or outside