I have a problem with the parameters. Sometimes, they just don’t show up. They just disappear. No rhyme or reason
Do you have code you can show or can you give more info about what’s happening. What parameters are you using.
99% of the time, parameters would be executed only once in the setup function. The other 1% of the time, you would clear and redisplay the parameters in another function based on an
if statement, the press of a button, the collision of physics objects, etc. Exactly how are you executing your parameter statements.
That’s strange. I thought I inserted the code. Here:
function setup() parameter.clear() rest = 0.2 parameter.number(rest, 0, 1, 0.2) physics.body(EDGE,vec2(0,0),vec2(WIDTH,0)) -- create floor b=physics.body(CIRCLE,40) -- create ball b.x=WIDTH/2 b.y=HEIGHT-100 end function draw() background(40, 40, 50) fill(255) ellipse(b.x,b.y,80) b.restitution = rest -- bouncyness of ball end
@niog2606 - You should have started by looking in the Reference link above.
You are using the parameter function incorrectly. Look at the examples provided.
You need " " around the name.
parameter.number("rest", 0, 1, 0.2)
Oh wow faceplam
Thanks for the help!