Hi, I am new at unity and I want to rotate edge of my enemy object but I googled a lot and the only algos that I find is about rotating whole object. Like;
obj.transform.rotation = Quaternion.Euler(0.0f, Mathf.PingPong(Time.time * 30f, 90.0f), 0.0f);
it rotates whole object of course, but I dont know how to focus on just an edge. I just want to rotate it like a door opening
One way to do this would be to do transform.rotateAround
. You can specify which axis and the amount of degrees. Here is the link to the docs: https://docs.unity3d.com/ScriptReference/Transform.RotateAround.html