Hello
I have this error (11,39): error CS0029: Cannot implicitly convert type UnityEngine.GameObject' to
TriggerSphere’ but I don’t found how to fix
in this code
using UnityEngine;
using System.Collections;
public class Character : MonoBehaviour {
public TriggerSphere ts;
private bool isJumping = false;
private GameObject moveToward;
void Update() {
if( isJumping && Input.GetKeyDown(KeyCode.A) && moveToward == null ) {
TriggerSphere tsClone = Instantiate( ts, transform.position, Quaternion.identity ) as GameObject;
tsClone.character = gameObject;
}
if( moveToward != null ) {
/* Note : B */
}
}
void OnCollisionEnter( Collision collision ) {
if( collision.gameObject.CompareTag("CanHit") ) {
isJumping = false;
/* Note : C */
}
}
void SetBounceTarget( GameObject go ) {
moveToward = go;
}
}
Thank you