Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
129 views
in Technique[技术] by (71.8m points)

javascript - Matter.Constraints:BodyB属性保持未定义(Matter.Constraints: BodyB property remains undefined)

I'm using matter.js and trying to add an object (candy) with a Matter.Body to options.bodyB.(我正在使用something.js,并尝试将具有Matter.Body的对象(糖果)添加到options.bodyB中。)

The error logs show that candy exists, has a body, and yet bodyB is undefined.(错误日志显示糖果存在,具有主体,但bodyB未定义。) 在此处输入图片说明 在此处输入图片说明 Here is the actual Candy class.(这是实际的Candy类。) 在此处输入图片说明 And here is where I actually pass the Candy to the Rope in the main class.(这是我实际上在主班级将糖果传递给绳索的地方。) 在此处输入图片说明   ask by ze boris translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to put:(尝试放入:)

console.log(options.bodyB); instead of:(代替:) console.log(bodyB);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...