+ 1
I know it is failing me, it is for a video game and I cannot find a solution
In the && operand it tells me that you cannot apply "Boolean" and "string" operands, so I don't know what could be wrong with me. https://code.sololearn.com/cQCzfyXnjr6X/?ref=app
3 Answers
+ 3
Also, Line 42
if (_collision.gameObject.CompareTag("Coins") && ("Obstaculo"));
This is incorrect.
1. CompareTag() returns a bool, as it should, but you're &&ing it with ("Obstaculo") which is just a string.
2. The if statement is followed immediately by a semicolon, so it has no body.
+ 1
You can not declare a class inside the Main() { } function!
I suppose you just copied this source code from somewhere. Also, some libraries definition are missing from the header part (using ...).
Nested types:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/nested-types
0
ok thanks it is for a game in unity, only in that line 42 an error appears and maybe someone knew why it is failing me