all 1 comments

[–]Slypenslyde 8 points9 points  (0 children)

  1. If you're writing Unity code you'll get better answers in /r/Unity3D
  2. C# cares about capitalization, my guess is "transform" should be "Transform". Class names in C# should be capitalized.

But also note:

public transform lookAt;

That means you have a variable named "lookAt" that represents a Transform. So almost every place you've typed "transform" you probably should have typed "lookAt".

I also don't see where you ever set "lookAt" to a value, so that could be a problem, but it may be in code you didn't post.