So here’s the deal
I am used JavaScript to make some scripts for my game
(which I sort of regret- it was a production speed choice)
Now I have a very performance heavy script that use coroutines every where in it and atm the moment does cause considerable lag.
here’s the problem
occasionally it will randomly call a function twice-which double spawns a component
are there any uber technical programmers who know the specifics of this bug?
does it stem from javascript or unity?
is there any way I can make it only callable once?
just to rule out all the obvious mistakes
-this script when it runs uses an event to spawn 8 other objects
-after testing it multiple times, there is no pattern on which of the child objects have their function double called, its completely random
- there is no random behaviors associated with this process
- there is only one source that calls the function in question and there simply is no way it can run itself multiple times without causing even greater chaos
- the source function is on the original object and the function in question is called on the spawned object
-nothing is run in a repetition loop, not even an update function is used
Sorry I can’t post the code, It’s just so massive, and such a chain of events that it would probably confuse everyone here and take forever to understand it. PS I didnt mean that in any sort of vain or ego blotted way.