What is wrong with my script

What is wrong with this javascript?

-function PrintEvent(num : int){
   debug.Log("HelloEvent"+num);
 
 }

why is there a ‘-’ in front of function?

What is the correct way?This is to print to the console of unity.

Debug needs to start with an upper case letter.

Okay, thankyou.That was a simple mistake.I use the blender and the blender game engine.So i thought i would try hands my hands with coding in unity.

It still does not work.

Try doing something like this :

var num : int;

function Update(){
Debug.Log("Hello Event" + num);
}

That worked thankyou.I am trying to learn from walkerboys tutorials.

It still does not work the way i want it to.
I get the error animationevent has no fuction specified.I am using the animation system to trigger a script.what do you think i did wrong?

I having trouble doing the tutorial unity app 9 10 animation event key.In the series of videos," WalkerBoy Studio - Video training and tutorials on vimeo."

Well, given that you are having trouble starting, I would expect you would have lots of trouble so deep into an advanced tutorial.

Way back when, when I started using Unity, I found this tutorial… It helped in the basics and understanding how all this fits together.

http://www.gameprefabs.com/pages/tutorials/wormgame

My suggestion is to start there. (since it is very simple) and work forward. You are starting at an advanced level and getting frustrated because its advanced.

function Update(){
   Debug.Log("Hello Event" + ++num);
}

This what you’re after? Incrementing “num” every time you log?

By the way, ++num will increment BEFORE it outputs while num++ will increment afterwards… so in my example it would start with 1… if you changed it to num++ it would start at 0.