#Memory Spike Issue
1 messages · Page 1 of 1 (latest)
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
i'm sure it has something to do with me instantiating gameobjects but i don't know what else to do to spawn in my players and the stage. for context, its a platform fighting game, something like Super Smash Bros, and i need the characters and the stage they play on to spawn in.
am i supposed to use this? i don't understand
a powerful website for storing and sharing text and code snippets. completely free and open source.
THere's a ton of extraneous and repetitive code in here that can be simplified a lot
As for the spike in memory... is it causing any kind of problem?
Is there a performance issue?
What made you worried about it?
But yeah you're allocating a good number of unecessary strings here. You're doing a ton of extraneous GetComponent calls. A ton of extraneous .transform property calls.
How much memory is a "big spike" exactly?
yea i tried testing it on a couple of my other friends computers and when switching to the scene with that script in the build, it would freeze and say "not responding" for like 30 seconds at best and 3 mins at worst
im not really sure what the best way to instantiate these prefabs are
and when i tested it on my pc, it averaged using like 500ish mb in memory and then would spike to 2-4 thousand mb
its SO BAD
ok so why are you worried about memory spikes
why aren't you worried about the CPU
Either way yeah it's definite;y time to bring in the profiler
just generally though this isn't that much memory
okay
focus more on the "my game is freezing for a long time" part