private void Update() { if (originalDirection == Vector3.zero && aditionalSpeedEnabled) { originalDirection = gameSceneController.getRoomDirectionAsVector(); } Vector3 translateBy = -1 * gameSceneController.roomSpeed * gameSceneController.getRoomDirectionAsVector() * Time.deltaTime; if (aditionalSpeedEnabled) { translateBy += originalDirection * aditionalSpeed * Time.deltaTime; } transform.Translate(translateBy, Space.World); }
private void Update() { transform.Translate(-1 * gameSceneController.getRoomDirectionAsVector() * gameSceneController.roomSpeed * Time.deltaTime, Space.World); }