- Home /
Question by
JakeProvinceStudios · Jan 01, 2014 at 11:52 PM ·
syntax
Help with syntax error
I am getting an error, it tells me that #pragma strict needs a semicolon. When I do so, It says that the semicolon is unexpected, please help.
#pragma strict
EOF
var Target : Transform;
var Distance = -10;
var Lift = 1.5;
function Update ()
{
Transform.position = Target.position + Vector3(0, Lift, Distance);
Transform.LookAt (Target);
}
Comment
Answer by Vonni · Jan 02, 2014 at 01:02 AM
Remove EOF (end of function) why is this even here?
you also need to change
Transform.position = Target.position + Vector3(0, Lift, Distance);
Transform.LookAt (Target);
to
transform.position = Target.position + Vector3(0, Lift, Distance);
transform.LookAt (Target);
because Transform
is the class and transform is a shortcut to GetComponent(Transform)
which is the Transform component on this scripts game object.
Your answer
![](https://koobas.hobune.stream/wayback/20220613125321im_/https://answers.unity.com/themes/thub/images/avi.jpg)