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

GameObject's OnAdded is being executed before spawn notification #1387

Open
cabeca1143 opened this issue Apr 5, 2022 · 1 comment
Open

Comments

@cabeca1143
Copy link
Contributor

cabeca1143 commented Apr 5, 2022

This results in client's not being properly notified by a few things, such as some particles, minimap icons and animation pauses applied by CharScripts.

There is a workaround, that is to delay changes by a single tick in OnUpdate, or make a manual Spawn Notification (resulting in 2 spawn notifications), but both are far from optimal.

A similar issue is spawning an unit and start making changes to it right after. Same thing, since the unit wasn't notified yet, the client wont be properly notified. You'd have to use one of the workarounds stated above.

I believe that ideally, a spawn notification should be made instantly on creation for all objects, or at least have the option to do so.

@Killfrra
Copy link
Contributor

Killfrra commented Apr 5, 2022

Possibly partially implemented:

/// Normally, objects will spawn at the end of the frame, but calling this function will force the teams' and players' vision of that object to update and send out a spawn notification.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants