Error Adding PhysicsSprite3D In A Scene

I want to add a PhysicsSprite3D in a scene. But it shows a weird error. (I think I did the Physics3D setup wrong.)

(ThreeD is the name of my class)

#include "physics3d/CCPhysics3D.h"
// the following code is in the ThreeD::createScene() function
auto scene = ThreeD::createWithPhysics();
return scene;
// the following code is in the ThreeD::init() function
Physics3DRigidBodyDes rbDes;
rbDes.mass = 0.0f;
rbDes.shape = Physics3DShape::createBox(Vec3(12.0f, 12.0f, 12.0f));
auto spr = PhysicsSprite3D::create("sprites/cubie.obj", &rbDes);
this->addChild(spr); // as soon as the program executes this, an error occurs

This is the image of the error. (It doesn’t show anything in the console.)

I will upload the full code if you need it.

Did you call initWithPhysics() in your scene init() method?

There is a working demo in cpp-tests, so check that out and see what the differences are between that test code and yours.

I did compare the cpp-tests code with my code and I didn’t think initWithPhysics() was required. :frowning:
I’m sorry for asking such a beginner’s question. Thanks for helping out! :smiley:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.