Hello
I’ve just started in unity a couple weeks back. I am attempting to make a certain circular motion happen when it’s in a certain position. However because of the codes i used to create the circular motion, it goes back to the default position of 0, 0 for x and y.
float timeCounter=0;
float speed;
float width;
float height;
void Start () {
speed = 2;
width = 0.3f;
height = 0.3f;
}
void Update () {
timeCounter += Time.deltaTime * speed;
float x = Mathf.Cos (timeCounter) * width;
float y = Mathf.Sin (timeCounter) * height;
transform.position = new Vector2 (x, y);
}
how do i place the circular motion in another position than 0, 0?