Im trying to instantiate an object from my character however i have an error :Cannot implicitly convert type `UnityEngine.Object' to`UnityEngine.Rigidbody'. An explicit conversion exists (are you missing a cast?
using UnityEngine; using System.Collections;
public class Trajectory : MonoBehaviour
{
public Rigidbody projectile;
void Update()
{
if (Input.GetKeyDown("space")) {
Rigidbody clone;
**clone = Instantiate(projectile, transform.position, transform.rotation);**
clone.velocity = transform.TransformDirection(Vector3.forward * 10);
Debug.Log("Hello");
}
}
}