BCE0023 no appropriate version of instantiate
sytem.type, unityenginevector3, unityengine.quaternion was found.
Hi there, this is probably an easy fix but I honestly cannot see the problem.
var waitInSeconds = 0;
var crateObject = Rigidbody;
function Start () {
yield WaitForSeconds(waitInSeconds);
Instantiate(crateObject, transform.position, transform.rotation);
}
so I’m pretty sure I have everything set up properly to instantiate the rigid body but it keeps giving me an error. it looks like the rigidbody is the problem but ive set up everything properly I think.
make the crateObject variable into a GameObject, not a RigidBody
Line 2, var crateObject = Rigidbody;
is assigning crateObject
to be the type Rigidbody
. That is why the error is complaining the first parameter is of type System.Type
. You want it to be an instance in your scene or a prefab. Change it to the code below. Make sure to set crateObject
in the inspector or it will complain about a null reference.
var waitInSeconds = 0;
var crateObject : GameObject;
function Start () {
yield WaitForSeconds(waitInSeconds);
Instantiate(crateObject, transform.position, transform.rotation);
}