I’m trying rotate a platform around a center while keeping the platform straight so that the character does not fall.
How to rotate the platform keeping it horizontal?
I’m trying rotate a platform around a center while keeping the platform straight so that the character does not fall.
How to rotate the platform keeping it horizontal?
I think you could use rotate around first, and then set the rotation to some object or something after, or use euler angles or whatever to set it afterwards for each segment of the rotation. I haven’t done it or anything.
I have tried do this using the RotateAround, but the object always remains facing the center around it is rotating of.
See for example this Sonic The Hedgehog 2 gameplay, what I want to do is the rotating platform of the time 54:23 to 54:26:
The platform stays horizontal, so I can step on it.
public class RotateAround : MonoBehaviour {
public GameObject aCube;
// Update is called once per frame
void Update () {
transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
transform.rotation = aCube.transform.rotation;
}
}