OnCollisionEnter2D not being executed?

I think its because of kinematic A kinematic Rigidbody2D will only collide with a dynamic Rigidbody2D body type. The exception to this is if Rigidbody2D.useFullKinematicContacts is set to true in which case it will collide with all other Rigidbody2D body types. Try setting Body Type to Dynamic and see if OnCollisionEnter executes. OR Add a dynamic Rigidbody2D to the other collider

Regex for numbers only

Use the beginning and end anchors. Use “^\d+$” if you need to match more than one digit. Note that “\d” will match [0-9] and other digit characters like the Eastern Arabic numerals ٠١٢٣٤٥٦٧٨٩. Use “^[0-9]+$” to restrict matches to just the Arabic numerals 0 – 9. If you need to include any numeric representations other than just digits (like decimal values for starters), then … Read more

Where can I find the assembly System.Web.Extensions dll?

EDIT: The info below is only applicable to VS2008 and the 3.5 framework. VS2010 has a new registry location. Further details can be found on MSDN: How to Add or Remove References in Visual Studio. ORIGINAL It should be listed in the .NET tab of the Add Reference dialog. Assemblies that appear there have paths in … Read more

Categories c# Tags

How can I get the application’s path in a .NET console application?

System.Reflection.Assembly.GetExecutingAssembly().Location1 Combine that with System.IO.Path.GetDirectoryName if all you want is the directory. 1As per Mr.Mindor’s comment:System.Reflection.Assembly.GetExecutingAssembly().Location returns where the executing assembly is currently located, which may or may not be where the assembly is located when not executing. In the case of shadow copying assemblies, you will get a path in a temp directory. System.Reflection.Assembly.GetExecutingAssembly().CodeBase will return the ‘permanent’ path … Read more

The remote server returned an error: (403) Forbidden

Add the following line: This will let the application use the credentials of the logged in user to access the site. If it’s returning 403, clearly it’s expecting authentication. It’s also possible that you (now?) have an authenticating proxy in between you and the remote site. In which case, try: Hope this helps.

Categories c# Tags