I recently updated my Unity (to 5.5.0f3 from 5.4.1f1), and now I seem to have some problems with a Rigidbody2D in one of my games.
So basically I used to use this code to make my gameobject (player) non-intractable and taken out of the physics controls:
Player.GetComponent<Rigidbody2D>().isKinematic = true;
This is not working properly after the update of Unity, and upon setting the player to kinematic it keeps moving in the same direction as when it was "dynamic" (but uncontrollable). Note: this was not the case in Unity 5.4.1f1.
So I went into the Rigidbody2D component and noticed that it had changed. How my old Rigidbody2D looked like and How my new RigidBody2D looks like now
The "kinematic" option was moved into a "body type" option, and in runtime it does change the body type to Kinematic using the ".isKinematic = true" string (but it's not working properly as mentioned before).
So I tried changing the body type value to "static" manually doing runetime and noticed that worked perfectly!
So my question is: How do i change the body type to static in the code? (like the "isKinematic"), and what happened in the changes to Rigidbody2D (and Kinematics?)
unity3d
(which it appears Scott did for you :) )Rigidbody2D
orPlayer
, you are using the Unity class library (i.e. the set of classes included with Unity), because those classes are not available without Unity. Indeed, as Luke said, I was referring to tagging your question here - because most users who know C# will still have no idea about the specifics of the mentioned Unity classes.