- Home /
Problem is not reproducible or outdated
More Unity bugs, sometimes it keeps restarting character position to (0,0,0)
Hello guys, I'm having another bug with unity :( I was just testing a few codes in my project that had nothing to do with the character movement or whatsoever, and suddenly, whenever i hitted the play button in the editor, my character touched the ground and then restarted to position (0,0,0). Then I tried Build & Run, and nothing happened, the game played normally. I just restarted Unity, because many bugs gets fixed with this, and then, before entering, it showed that loading bar "compiling scripts" and entered without the bug happening. After a few minutes, the bug happened again, and restarting unity didn't solved. After restarting unity for the 20th time or something, it showed that loading bar "compiling scripts" and the bug disappeared. What's happened? I know i already solved the problem, but I get problems like this very often, Unity bugs randomly and fixes itself randomly too. It's not a big deal, but sometimes it gets annoying and makes me think that its something with my scripts. Well, I hope someone can help me.
( to make it clear, I really doubt that it have something to do with my scripts, because it fixes itselft without changing any line, its just as i said, it fixes randomly after restarting unity a few times. )
Also, i think it have something to do with Unity's Physics engine. Recently i got a glitch that every raycast of $$anonymous$$e was getting random values, and physics was all glitched up, i even asked here what could it be. After restarting a few times, It solved the problem and Physics went back to work normally.
It is probably best to report this to unity if you haven't already. I've never had what you're describing happen to me. If restarting unity often fixes your bugs than you might try reinstalling unity. And, if you're using drop box or something similar, maybe you should reevaluate how you store/share projects.
Seems like it happens often enough (not once every 6 hours) that you could add/remove components and maybe bracket the the area causing the problem. Be nice if it was something you did, so you could just stop doing it. For example, touching a prefab's mesh breaks the project.
Well, actually, i'm storing the project in my own HD on the PC, basic stuff. Well, it doesn't happen THAT often, let's say, every three days i get one bug like this, but sometimes it just don't go off that easily @_@ And yes, it happens randomly. I touch nothing, and when it happens, i make sure to don't change anything, any script or asset, i just restart unity until it fixes.
That makes no sense at all. I've worked with Unity since version 2.5 and never got any "random" bugs and i had quite complicated projects. I have around 200 projects on my HD and one dedicated for UA with over 70 subfolder for different questions here, each with a seperate scene file. Unity always worked as expected and if not it was me doing something wrong.
Your question is pointless in it's current form. It can't be answered nor can it be reprocuced since you provided no information except a description of symptoms.
So here are some counter questions:
Do you use animations? If so for what and when?
What components are on the offending object (the player i guess?)?
Do you have any editor scripts in your project (maybe your own maybe from other plugins / packages)?
Do you have a respawn script of any kind? If so when is it called / how does it work?
Can you post a screenshot of the initial position of the player?
Is the player object in the scene or is it instantiated at runtime via script?
Do you have any triggers in the scene which might be anywhere near the player?
Is the game 2d or 3d? Which collider / rigidbody / charactercontroller are you using?
What's your development system? (OS, Unity version, ...)
And now it's 04:00 and i need some sleep ;)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Set controller to active script - how do I transform him to the correct position? 1 Answer
Targetting script bug. (Javascript) 0 Answers
question about instantiating 2 Answers
Parsing Error CS8025 1 Answer