So im VERY new to c# and I was using the tutorial scripts for PlayerPlatformerMovement and PhysicsObject etc. to make a basic 2D game. I copied it word for word but 2 errors came up which i cant seem to figure out. Wondering if any of you guys could help? :)
the errors are:
Error CS0246 The type or namespace name 'ContactFilter2D' could not be found (are you missing a using directive or an assembly reference?) Assembly-CSharp C:\Users\R4YH4N\Desktop\New Unity Project 1\Assets\PhysicsObject.cs
Error CS0115 'PlayerPlatformerController.computeVelocity()': no suitable method found to override Assembly-CSharp C:\Users\R4YH4N\Desktop\New Unity Project 1\Assets\PlayerPlatformerController.cs
im using visual studio to edit the scripts btw
For the first error, this implies there should be a script with the name 'ContactFilter2D'. Did you perhaps create it but with different casing? Make sure to look at the class-name, not just the file-name. (Look for 'public class ContactFilter2D')
For the second error, again my guess is that you made a typo in the casing. You possibly created a method ComputeVelocity, and try to override with computeVelocity
However, these are just guesses. If you post your code you have a much bigger chance of getting a solution.
I am having the same error. According to the Unity documentation ContactFilter2D should be a struct in the UnityEngine. I have using UnityEngine in my script but when I start typing ContactFilter2D no autocomplete shows up. I am guessing that this is a struct that is only available in Unity 5.6 beta versions. When I type ContactFilter2D into the 5.5 documentation, I get no results. I only get results when I set the documentation to 5.6.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
5 People are following this question.
2D Animation does not start
Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement
"cover" a Trigger2D using a sprite
If player faces right, shoot right. viceversa?
Why does my 2D raycast keep firing at the 0,0,0 world position?