- Home /
Checking if Player object is out of bounds
Hello, I have written a javascript code for checking the player if they have fell out of bounds. This is a 3D platformer that I am tring to make.
I am recieving errors and can not run the game with this script. What am I doing wrong in the code? Please help!
one problem is using javascript but not the variable style
function OnCollisionEnter(Collision col)
Other then the function and no return type(or void) this looks like c#
The javascript version looks like:
function OnCollisionEnter(var col : Collision)
Thanks Landern! I was following a tutorial of something related to this. But I guess they must of been using C# to code it.
I decided to start with Javascript because I heard it was more easier to code and to understand.
I seem to be still having trouble with the code. After making the changes that you gave. I'm receiving a few errors called, "expecting EOF, found 'col'" & "Unexpected token: var"
Any suggestions how to fix these?
What is the name of the file you're entering the code into, does it end with ".cs" or ".js"?
Your answer
Follow this Question
Related Questions
Detect a gameObject's tag via OnCollisionEnter() 5 Answers
Change Direction on Collision 6 Answers
get angular velocity change from collision 0 Answers
Collision with no contact? 2 Answers
How to end a coroutine early 0 Answers