fix: kill self entity when destroying
This commit is contained in:
parent
28e5e9f56f
commit
f78978c88e
|
@ -15,12 +15,16 @@ export default () => {
|
|||
if (!room) {
|
||||
return;
|
||||
}
|
||||
const onDestroying = () => {
|
||||
setEntity(undefined);
|
||||
};
|
||||
const augmentSelfEntity = async (entity) => {
|
||||
if (entity) {
|
||||
await entity.addTraits({
|
||||
Controllable: {},
|
||||
Followed: {},
|
||||
});
|
||||
entity.on('destroying', onDestroying);
|
||||
}
|
||||
setEntity(entity);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user