|
Hi, im new on unity, and on game programming. I'm trying to make a translate of a missile a little more than a simple transform.forward, im trying to add two waves on x and y axies. here is the working code: function Update () { } here is the wrong code: private var player:GameObject; player=gameObject.Find("Player"); private var distanceToPlayer:float; distanceToPlayer=Vector3.Distance(transform.position,player.transform.position); private var numIteration:float; numIteration=1; private var waveHeight:float; waveHeight=1; private var ondex:float; private var ondey:float; function Update () { } Can you help me? Thx
(comments are locked)
|
|
i forgot the error message: BCE0023: No appropriate version of 'UnityEngine.Transform.Translate' for the argument list '(float, float, UnityEngine.Vector3, null)' was found. i don't understand this error :(
(comments are locked)
|
|
The problem is you are passing the wrong argument in transform.Translate. The third value in transform.Translate is an entire Vector3 instead of a float. Unity expects a single float value for the z coordinate of the translation, but you are giving it an entire vector so it doesn't know how to use it. You should write:
(comments are locked)
|
