First off let me start by saying that this glitch only seems to happen in build mode.
Secondly, let me give you a little background on how these particular elevators work.
| if you have ever played Metroid 3 you may remember how the elevators would (when activated) start moving
and then change the scene at a certain point then continue down or whatever <that’s what mine are doing>|
this is done (in my game) by having the elevators set an elevator id int inside of a ScriptableObject when the elevator leaves. Then upon scene change any elevators in the next scene then check the ID and if it matches that elevator’s id it will set the car’s position to the top of the shaft and then bring the car down. and vise versa.
it’s also important to note that the elevator platform is in control of the car’s RigidBody and the car is a child of the platform. (Everything is done by localPosition)
But sometimes, the car will appear in a weird place in the scene and be stuck there. Like I said it doesn’t seem to happen in the editor (only in build mode).
I have provided a temporary fix that works like this:
On Start the behavior will invoke a glitch check function after .01 seconds and the glitch check will check the car’s local position X and if its not within an acceptable range then reload the scene. The scene will maybe reload once or twice until the glitch irons itself. It does not happen every time, but the glitch check seems to catch it when it does.
However, this is not an ideal fix so does anyone maybe know what might be causing the problem in the first place?
Thanks