Question by
redpostman · Mar 06, 2018 at 12:41 PM ·
cameracamera-movementissuecubesnan
unity3D how can i get the solution to transform.position assign attempt for 'main camera' is not valid. input position is nan nan nan?
This is my code of the camera:
public class followcamara : MonoBehaviour {
// Update is called once per frame
public Transform player;
public Vector3 offset;
void Update ()
{
//debug.log(player.position); imprime la posicion del jugador.
// transform.position = player.position; // si solo dejamos esta porcion de codigo,
//la camara se pusiera en el jugador en 1ra persona, pero como la camara en este juegos la queremos en 3ra
//persona, le agregaremos lo siguiente.
transform.position = player.position + offset;// asi la camara se centra y se modifica a las coordenadas
//que le pongamos.
}
}
These are the values of offset that i put on the inspector: 0.1,2,-5
I get a lot of error, but these are the first three:
These happens when I'm playing in the edge of a road at an certain rotation, something like these, but in the edge of the road. So when it happens y just disappear, and y give me a lot of errors. How can i fix these? I am new on unity. is my first time asking. I have to say to, its a endless runner so the object is constanly moving to z+,
error-4.png
(16.6 kB)
error3.png
(10.3 kB)
Comment
I came across this post that may be of use to you by 'Donay'
A post on the same thread by dieqoo mentions enabling PC$$anonymous$$ mode in Physics $$anonymous$$anager fixing the issue.