- Home /
Question by
smirlianos · Aug 20, 2013 at 06:15 PM ·
errorvector3lerpline
Vector3.lerp doest work
Hello, I have this script that's supposed to move the camera more smoothly by moving the player. But it doesn't work and it gives me this message on line -1.
MissingFieldException: Field 'UnityEngine.Vector3.transform' not found.
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateGetter ()
Boo.Lang.Runtime.RuntimeServices.DoCreatePropGetDispatcher (System.Object target, System.Type type, System.String name)
Boo.Lang.Runtime.RuntimeServices.CreatePropGetDispatcher (System.Object target, System.String name)
Boo.Lang.Runtime.RuntimeServices+<GetProperty>c__AnonStorey14.<>m__9 ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
This is the script:
var player : GameObject;
var offset : Vector3;
function Start () {
offset = player.transform.position - transform.position;
}
function FixedUpdate () {
transform.position = Vector3.Lerp(transform.position, offset.transform.position, Time.time);
}
Comment
Best Answer
Answer by Eric5h5 · Aug 20, 2013 at 06:18 PM
It works fine, you just have to use data that makes sense. Since offset is a Vector3, "offset.transform.position" makes no sense.
Aside from that, you would not use FixedUpdate, nor would you use Time.time as the third parameter. http://answers.unity3d.com/questions/14288/can-someone-explain-how-using-timedeltatime-as-t-i.html
Your answer
Follow this Question
Related Questions
Error cannot convert quaternion to vector3 4 Answers
tell me whats wrong with this lerp 1 Answer