Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disables the serialization of RelativeLocation for root components. #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OmikronX
Copy link

@OmikronX OmikronX commented Feb 8, 2020

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.

… it was causing problems with PhysicX when spawning multiple prefabs at Runtime.
@OmikronX OmikronX force-pushed the physx-related-improvements branch from 56e9f36 to 6dfc145 Compare February 23, 2020 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant