hi guys, befor starting i apologize for my bad english
i’m creating a game where 2d and 3d coexist. i have a 3d object with a rigidbody and a boxcollider attached (player) an a 2d sprite with a boxcollider and a circle collider attached (a statue).
i want to use the circle collider as a proximity detector: when the player trigger the circle collider it will enable the statue so he can interact with it and then disable the statue as the player is too far.
i checked “isTrigger” on the circle collider but when the player collide with it he cannot pass through…
also the onTriggerEnter event isn t rised.
how can i fix this?couldn’t i use trigger beetween 2d and 3d?
please help me i’m really stucked here
ps: i post the script attached to the statue.
using UnityEngine;
using System.Collections;
using System;
public class Statue : MonoBehaviour {
//public IList<Memory> Memories;
private bool isEnabled;
private Component halo;
public void Teleport(){
}
// Use this for initialization
void Start () {
halo = GetComponent ("Halo");
}
public void OnTriggerEnter2D(Collider other){
Debug.Log ("enter");
halo.GetType ().GetProperty ("enabled").SetValue (halo, true, null);
}
public void OnTriggerExit2D(Collider other){
Debug.Log ("exit");
halo.GetType ().GetProperty ("enabled").SetValue (halo, false, null);
}
// Update is called once per frame
void Update () {
}
}