Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Newly created actor without ownership will properly receive default ownership once authoritative user is assigned #744

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/sdk/src/core/contextInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,15 @@ export class ContextInternal {
actor.copy(sactor);
if (isNewActor) {
newActorIds.push(actor.id);
if (actor.rigidBody) {
if (actor.rigidBody) {
if (!actor.owner) {
actor.owner = this._rigidBodyDefaultOwner;
if (!this._rigidBodyDefaultOwner) {
this._rigidBodyOrphanSet.add(actor.id);
} else {
actor.owner = this._rigidBodyDefaultOwner;
this._rigidBodyOwnerMap.set(actor.id, actor.owner);
}
}
this._rigidBodyOwnerMap.set(actor.id, actor.owner);
}
}
});
Expand Down