I get the Error "InvalidCastException: Cannot cast from source type to destination type.", when I tried to use this script:
void OnTriggerEnter(Collider other)
{
...
direction = new Vector3(1, 0, 0);
StartCoroutine(Boost());
...
}
IEnumerator Boost()
{
...
iTween.MoveBy(gameObject ,iTween.Hash("amount", Vector3.Dot(new Vector3(bd, bd, bd), direction), "space", Space.World, "time", bd));
yield return new WaitForSeconds(bd);
...
}
(bd is an integer)
I don't understand this Error.
Thanks!
↧