I have a Body that is already added to the world. I want to update the color.
var ball = Bodies.circle(xPosition, yPosition, 25, {
force: {
x: rand(-0.0005, 0.01),
y: -0.01
},
restitution: 0.75,
render: {
fillStyle: '#A87FB5',
},
});
World.add(world, [
ball,
]);
I have tried:
Body.set(ball, fillStyle, '#754C82');
Body.set(ball, render.fillStyle, '#754C82');
Body.set(ball, {render: {fillStyle: '#754C82'}});
I suspect I'm using the wrong approach. Unless I've overlooked it, I can't find anything in the documentation about how to update this.
Apparently that is one of the properties that you can just reach in and change