#what is this and what do i do?
1 messages · Page 1 of 1 (latest)
Explain me the line 26 (and why it has no arguments)
Also this ⬇️ . Your IDE doesnt seem to highlight the error properly
[]noint
How to deal with no VS intellisense problem:
If you have opened script and see Miscellaneous Files in place where should be name of your project (see screenshot below) it means that the file was not correctly loaded into project or you don't have any project loaded. Follow these steps to fix this:
- Unity tools and Unity IDE preference - make sure to install the Unity Tools in your VS Installer and check the Unity preferences
Edit - Preferences - External Toolsand verify that the right External Script Editor is selected (you want Visual Studio there). - Reload project -
View - Solution Explorerright click on project and clickUnload projectthen right click on it again and load it again. If you don't see any project in Solution Explorer then move to the next step. - Regenerate solution files - Remove the
.slnand.csprojfiles from root of your unity project (in File Explorer), they will be regenerated next time you open script from Unity.
How to deal with no VSCode intellisense problem:
Follow the guidelines on this page:
https://code.visualstudio.com/docs/other/unity
https://cdn.discordapp.com/attachments/545801512173961239/553525896045133826/unknown.png
i thought that it would make the code run
im new to programing
It would if you made it correctly. I dont understand why you would want to call the OnTriggerEnter2D function every frame tho (and why would you call it yourself to begin with)
uuuh ok, how do i make it work
Watch tutorial about OnTriggerEnter
You are not supposed to call it yourself, unity does that for you when collision is detected
what is this about
Hard to tell without seeing the code
i somehow removed it a sec ago
wait
ill test if everything works now
it doesnt show any errors but
the script does nothing
wait
ill send it
here it is
nvm i found the error
i needed to make it on collission enter 2d
helpp
Fix your ide first
I don't use VS Code myself, so here's what I got from Google: https://code.visualstudio.com/docs/other/unity
Looks pretty in-depth.
I already gave the resources on the very beginning of this thread
@fallow pasture OnCollisionEnter2D requires a Collision2D parameter, not Collider2D.
Apart from that, spelling is important. One wrong letter can break your code. You wrote OnTriggererEnter2D at the beginning, whereas it should be OnTriggerEnter2D.
You'll avoid this kind of mistake by fixing your code-editor (Visual Studio Code is not an IDE), so that your auto-complete suggestions work.