- Home /
Question by
nazmulcsharp · Jul 29, 2018 at 04:38 AM ·
movecircle
How can move the ball around the circle?
Hello! am new to game development unity. I am trying to move ball around the circle always.
Circle has polygon collider 2d
Ball has circle collider 2d and rigidbody2d would you help me to figure out how can I do this
screen-shot-2018-07-29-at-103255-am.png
(43.2 kB)
Comment
Answer by DeathOfAshes · Jul 29, 2018 at 04:50 AM
Are you wanting the ball to move around the inside of the circle? If so a simple add force script and an invisible smaller circle that makes sure the ball doesn't fall down should do it.
sir I added invisible circle. can you help me for force scripts.
void Update()
{
rb2D.AddForce(transform.forward * 10);
}
Also can you attach the sprites you used so I can test the code out?