You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 4 cubes and walls created using 4 recatangles. And at the beginning of the game I give the cubes an initial speed, but these cubes do not repel when they collide with a wall
const initialEnemyCube = Matter.Bodies.rectangle(
pos.x,
pos.y,
size.width,
size.height,
{
label: label,
inertia: Infinity,
restitution: 1,
friction: 0,
frictionAir: 0,
frictionStatic: 0,
},
);
The text was updated successfully, but these errors were encountered:
Beknur2002
changed the title
Objects are not repelled when restitution: 1, friction: 0, frictionAir: 0, frictionStatic: 0
Objects are not repelled when restitution: 1, friction, frictionAir and frictionStatic is 0
Sep 23, 2023
I have 4 cubes and walls created using 4 recatangles. And at the beginning of the game I give the cubes an initial speed, but these cubes do not repel when they collide with a wall
const initialEnemyCube = Matter.Bodies.rectangle(
pos.x,
pos.y,
size.width,
size.height,
{
label: label,
inertia: Infinity,
restitution: 1,
friction: 0,
frictionAir: 0,
frictionStatic: 0,
},
);
And wall
const initialBox = Matter.Bodies.rectangle(
pos.x,
pos.y,
size.width,
size.height,
{
label: 'Box',
isStatic: true,
inertia: Infinity,
isStatic: true,
restitution: 1,
friction: 0,
frictionAir: 0,
frictionStatic: 0,
},
);
And entities
return {
physics: {engine, world},
};
The text was updated successfully, but these errors were encountered: