The error is: error
-CS0039: Cannot convert type
UnityEngine.Rigidbody2D' to
UnityEngine.Rigidbody’ via a built-in conversion
-error CS0120: An object reference is required to access non-static member`UnityEngine.Transform.rotation’
-error CS0120: An object reference is required to access non-static member `UnityEngine.Transform.position’
Note: my code worked prior to updating to unity 5.5
using UnityEngine;
using System.Collections;
public class AA : MonoBehaviour
{
public Rigidbody2D projectile;
public float speed = 20;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown("s"))
{
Rigidbody instantiatedProjectile = Instantiate(projectile, transform.position, transform.rotation) as Rigidbody;
instantiatedProjectile.velocity = transform.TransformDirection(new Vector3(0, 0, speed));
}
}
}