Gravity problem (javascript)
i want my player to change the graviity when he is dead, so in that function i wrote this and its not working gives 3 errors.
function Die()
{
canMoveUp = false;
canMove = false;
GameMaster.canScore = false;
GameMaster.finalScore = GameMaster.currentScore;
Ground.groundCanFollow = false;
this.GetComponent<rigidbody2D>().gravityScale = 1f;
}
here are the errors: Assets/Scripts/Player.js(78,40): BCE0043: Unexpected token: ). Assets/Scripts/Player.js(78,41): BCE0044: expecting ), found '.'. Assets/Scripts/Player.js(78,42): UCE0001: ';' expected. Insert a semicolon at the end.
this.GetComponent<rigidbody2D>().gravityScale = 1f;
add ";" at the end of your line?
Well there is still a place where a semicolon : ";" is missing. $$anonymous$$aybe put more of your script?
Your answer
Follow this Question
Related Questions
Why is my characters Y position being controlled by its Gravity Scale? 0 Answers
Change Gravity on falling objects 1 Answer
Gravity stop working after adding 2nd layer 0 Answers
Trying to make an event triggered Pendulum Group fall 0 Answers
How to change the player gravity level?,How to change the value of the players gravity? 1 Answer