character scripts for a 2d sidescroller (HELP)

So I have found a good many scripts around that are for a character to be manipulated in 2d space for a sidescroller game. Now, the thing is that none of them work (or the way I build them just sucks). What I do is I use Notepad (pc) and I use it to write all the scripts. When I save i chose “All FIles” for the file type and just finish the name of the file with an extension like .js . Is this a good method of building a script like this? If not, what is, and how would I build it?

Thanks!

I attatched an example file, even though it isnt a script for the character (it is for the camera). This script is also broken…1271003–56492–$Camera Follows Player.js (160 Bytes)

Start using Notepad++. It have good support with color theme.

As i saw the code, you left ‘=’(equal sign) in first line of Update().

from your script I think you have to delete the Sign “=” after the variable " distanceFromPlayer " , because you define the value of the variable in the begin of the Script

@MicroEyes @SpeedKabal thanks guys! Ill look into that.

var Target : Transform;
var distanceFromPlayer = 10;

function LateUpdate () {
    transform.position = Target.position + new Vector3(distanceFromPlayer,0,0);
}

Does this work? I removed an extraneous minus sign in front of the method signature, the spare equals sign and added the new keyword to the constructor call, because I’m assuming it’s the same as C# in regards to constructor syntax.