I am getting Error CSO131 on the 15th line, but when I check the 15th line, nothing seems wrong… I am new to Unity and I am trying to make a c# script so the Enemy Player Faces the Player…
Thanks,
I am getting Error CSO131 on the 15th line, but when I check the 15th line, nothing seems wrong… I am new to Unity and I am trying to make a c# script so the Enemy Player Faces the Player…
Thanks,
CS0131 - he left-hand side of an assignment must be a variable, property or indexer.
PlayerPrefs is a class that contains convenience methods for saving primitive types(float, int, string types).
You’re trying to stuff a Transform type into a PlayerPrefs class, this is not how this works whatsoever. You would need to have a similar type, say like another Transform type on the left side of the equal sign. It also doesn’t seem to have any use, delete line 15 and 14 unless you explain what you’re trying to do.
Also please post formatted code rather then a screen shot.
Edit:
It appears your mistake is you want to push the transform to your “player” field.
Change line 15 to:
player = go.transform;