P5js loads everything black

So I was making a game with the p5js library and another one which is mostly unknown but which I am sure is not problem. Code as simple as this:

<>
var button;
var player;
var x = 0, y = 0.5, z = 0

function setup() {
createCanvas3D(windowWidth, windowHeight);
background3D(“#ffffff”);
changeCamera(ORTHOGRAPHIC);
hideToolbox();
console.log(width, height)
hideGrid()

noStroke();
fill(255);
ellipseMode(RADIUS);

diffuse("orange");
roughness(0.1);

player = sphere(x, y, z, 0.5);
var name = prompt()
player.name = name
console.log(player)

}
function draw() {
setCamera(10 + player.position.x, 10 + player.position.y, 10 + player.position.z, player.position.x, player.position.y, player.position.z)
}

function windowResized() {
resizeCanvas3D(windowWidth, windowHeight);
}
<>

will run fine on the pc and android. This means that the ball is showing up orange. However on an original IOS device like Ipad everything is showing up black. I also checked with the chrome console log and there seem to be no error.

If anybody knows how to fix it thank you because it is really bothering me and I have to have this project finished by sunday.

Hi @SGTMM,

Where does the createCanvas3D and background3D functions come from? (they are not in the standard p5js library)

1 Like