I have a Paddle that rotates following the shape of the circle, the problem is that I need the concave part of the Paddle to face the center, that is, rotate its Y axis from 0 to 180 to look at the center.
the code to move following the circle
float timecounter = 0;
public Transform target;
public float speed = 3.0f;
public float width = 100.0f;
public float height = 100.0f;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
// movimiento circular
timecounter += Time.deltaTime * speed;
float x = Mathf.Cos(timecounter) * width;
float y = 3;
float z = Mathf.Sin(timecounter) * height;
transform.position = new Vector3(x, y, z);
}
}
i try transform.LookAt and the Quaternion.LookRotation but i can’t make it work
,