General rule of thumb: nothing involving physics is simple - ever! ;) It would probably be a lot easier to fake all of this by generating a random number in the backend and then playing one of two animations (one where the pin ends up on a "WIN", another one where it lands on a "LOSE") depending on its value.
That being said, if you still want to do it your way, take a look at PinJoint2D.
Your wheel would be a RigidBody2D
(with gravity set to 0) and each peg a StaticBody2D
, added as a child and offset in position, so it lies on the edge of the spinning disk. Now add a PinJoint2D
for each of your pegs, where "Node A" always is the RigidBody2D of your wheel and "Node B" is the StaticBody2D of your peg (set these as properties in the inspector).
If you now apply any angular_velocity
to the RigidBody2D, the pegs surrounding it should start rotating around the center (but will slow down over time because of the simulated physics). So all that's left to do now is adding the pin by placing another RigidBody2D
and StaticBody2D
(but this time: not as children of the wheel!) and connect them via a final PinJoint2D
. The static part will keep the pin "nailed to the wall", while the rigid part will behave flexible and be pushed aside by the pegs moving by and colliding with it.