I have no idea how to fix a "pragma strict error : unrecognized pragma directive" error.

My “Ask a question” history is full of different posts about different problems I encountered on coding different games. I apologize. I decided to end this randomness problem and I’m going to stick with Pong.

This is the error I’m getting “Unrecognized pragma directive” on the first line of “MoveRacket.cs”. I did a hasty Google search on it and my search came back with no working results so I posted on this forum. I’m guessing that I’m missing a compiler directive(?). That’s about all I know. Can anyone help?

(My code is currently nothing because I’m just starting)

#pragma strict

var moveUp : KeyCode;
var moveDown : KeyCode;

Function Update() 
{

}

Hi @Brian-Washechek

I think that your problem is the same here, you are using JS syntax within a C# file.

Change your file extension to .js and let me know if it works.

Good luck with your game!