- Home /
Question by
Zynpo · Jun 30, 2015 at 04:32 PM ·
2drotatearound
RotateAround - opening a door in 2D
If I have a door (in 2D) and I want to swing it open inwards., How would i do this in a 2D game? Is RotateAround the way to go?
I have tried all kinds of variations of RotateAround with no luck. I assume I would want to rotate around the Y axis from 0-90 degrees? My axis I set to be the very right middle of the door. I am not sure what point should be.
Vector3 point = new Vector3(0,1,0); Vector3 axis = new Vector3(doorAxisX, doorAxisY, 0);
Door.transform.RotateAround(point, axis, 50 * Time.deltaTime);
Any ideas how to make this work?
Thanks in advance. --Mike
Comment
Your answer