a gameObject we have configured the way we want, then saved as a prefab
easily adding instances of the prefab to a scene in the editor
easily adding instances of the prefab to a scene from a script(spawning)
Prefabs | SpritePrefabs | Sprite change
Component added to Prefab
Component applied to GameObject from PrefabComponent applied to GameObject from PrefabRigidBody2D | GetComponent() | RigidScript attached to a GameObjectScript working in a GameObjectInspector | Prefab ApplyPrefab change Applied
Collision Detection
Detecting collisions between gameObject
if both game objects have 2D collider, the Physics 2D engine automatically does collision detection
Edge ColliderBox ColliderPhysics MaterialPhysics applied to Collider
Collision Resolution
Doing something based on the fact that a collision has been detected
2D Physics materials for the game object colliders determine how the Physics 2D engine resolves the collision(Friction/Bounciness)
Additional collision resolution by ourselves is possible
we can get other components that are attached to the same Game Object this script is attached to by calling “GetComponent” and we put that component into a variable
RigidBody2D.AddForce
public void AddForce(Vector2force, ForceMode2Dmode = ForceMode2D.Force);
ForceMode2D
ForceMode2D.Force – Add a force to the Rigidbody2D, using its mass.
ForceMode2D.Impulse – Add an instant force impulse to the rigidbody2D, using its mass.