- Home /
Odd player teleporting
This is a hard thing to explain, but I have the beginnings of a simple zombie survival game. They randomly spawn and you shoot them and they die. For some reason, however, the second I start the game, the first person controller goes to 0, 0, 0 on the terrain. I have no idea why. If you start to walk off, you sort of slowly slide, but if you jump you fly over the edge. I have a spawning code, an ai code, a firing code, a kill code for the enemy, and an explosion for the grenade. What would be affecting it, and how could I fix it?
Do you have an editor other than the built-in one in Unity for writing your scripts? I had a problem sort of similar to this some time ago, and I did a search for something like "transform.position = " across every single source code file I had, to retrace all the places where the position of the offending object was being set. For me, it turned out some obscure function in some other script I'd forgotten about in the rush of things was setting the position, overriding whatever I did in the editor or the object's own Start.