File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,13 @@ void Workspace::InitService() {
78
78
// physicsWorld->setSleepAngularVelocity(5);
79
79
80
80
physicsWorld->setEventListener (&physicsEventListener);
81
+ }
81
82
82
- // Sync all parts
83
+ void Workspace::OnRun () {
84
+ // Make joints
83
85
for (auto it = this ->GetDescendantsStart (); it != this ->GetDescendantsEnd (); it++) {
84
- std::shared_ptr<Instance> obj = *it;
85
- if (!obj->IsA <Part>()) continue ;
86
- std::shared_ptr<Part> part = obj->CastTo <Part>().expect ();
86
+ if (!it->IsA <Part>()) continue ;
87
+ std::shared_ptr<Part> part = it->CastTo <Part>().expect ();
87
88
part->MakeJoints ();
88
89
}
89
90
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ class DEF_INST_SERVICE_(explorer_icon="workspace") Workspace : public Service {
75
75
void updatePartPhysics (std::shared_ptr<Part> part);
76
76
protected:
77
77
void InitService () override ;
78
+ void OnRun () override ;
78
79
bool initialized = false ;
79
80
80
81
public:
You can’t perform that action at this time.
0 commit comments