Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

error CS0266: Cannot implicitly convert type `UnityEngine.Object' to `UnityEngine.Transform'. An explicit conversion exists (are you missing a cast?) an iterator interface type - C#

$
0
0
hi i am trying to Rock Dorpper and after 5 seconds wait, but I keep getting Error CS0266 public class RockDorpper : MonoBehaviour { // Instantiates prefab when any rigid body enters the trigger. // It preserves the prefab's original position and rotation. public Transform [] prefab; public int prefabLength; void Start(){ prefabLength=prefab.Length; } IEnumerator OnTriggerEnter(){ Transform clone =Instantiate (prefab[Random.Range (0,prefabLength)]); yield return new WaitForSeconds(5); clone.rigidbody.isKinematic = true; } help me plz

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>