Exo_Guid
11 months agoMHCP Partner
Async SetInterval Issue (spawned asset)
I'm trying to have a loop on a spawned object. When it's spawned it's sent and receives: const spawnAssetEvent = new CodeBlockEvent<[player: Player]>('setup', [PropTypes.Player]); I've connec...
- 11 months ago
I created a manager object that does a list of activespawns and only sends the message to items on the list. I changed my code and moved the gettickEvent inside the spawnAssetEvent to assure this.player was set.
start() { this.SPAWNMANAGER = this.props.SPAWNMANAGER!; const spawnAssetEvent = new CodeBlockEvent<[player: Player]>('setup', [PropTypes.Player]); this.connectCodeBlockEvent(this.entity, spawnAssetEvent, (player: Player) => { this.player = player this.initialize(); this.sendCodeBlockEvent(this.SPAWNMANAGER, registerSPAWNED, this.entity); this.connectCodeBlockEvent(this.entity, getTickEvent, this.worldtick.bind(this)); }); ///gives ownership errors on DefaultWhat ultimately fixed my issue was changing my script execution from Local to Default. yay emote?