- Home /
Question by
ouim · Jul 10, 2014 at 03:55 AM ·
script error
transform.position assign attempt for not valid. Input position is { NaN, NaN, NaN }
On my first project, I get this error .... help please.
using UnityEngine;
using System.Collections;
public class motionControl : MonoBehaviour {
private Animator animator;
private float speed=0.0f;
void Start () {
animator = GetComponent<Animator> ();
}
void Update () {
if (animator) {
speed=0.0f;
if(Input.GetKey ("w"))
speed=1.0f;
}
animator.SetFloat ("Speed", speed);
}
}
Comment
$$anonymous$$aybe you devide by zero somewhere (speed is zero sometimes), that's the only thing I can see
I see how a division by 0 could be a problem... but where does a division occur?
Your answer

Follow this Question
Related Questions
SyncListStruct Unity Error 0 Answers
The type or namespace "UnityEngine" could not be found - Can not edit scripts 2 Answers
Error while creating an object 0 Answers
All my scripts have stopped working after trying to build & run 1 Answer
Problem with arrays and accessing sriptable objects. 2 Answers