Disables the serialization of RelativeLocation for root components.#22
Open
OmikronX wants to merge 2 commits into
Open
Disables the serialization of RelativeLocation for root components.#22OmikronX wants to merge 2 commits into
OmikronX wants to merge 2 commits into
Conversation
… it was causing problems with PhysicX when spawning multiple prefabs at Runtime.
…ints when spawning prefab at runtime.
56e9f36 to
6dfc145
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I run into an issue if I try to spawn a huge amount of prefabs at runtime.
If the components in prefabs have collisions set to Query and Physics the game starts to choke and eats up all the memory. Upon investigations, I found out that all the components are spawned on top of each other which causes PhysX to deal with the overlaps when the component is registered (or at least I think so) and significantly slows down.
Therefore, I have disabled serialization of RelativeLocation for root components. The root component relative location is redundant as it equals to the actor location. Restoring the relative location will essentially put all spawned components (from different prefabs instances) on top of each other even if the prefabs are spawned at different places.