- Home /
Click listener not working with imported game objects?
I importing .FBX object from 3d max into Unity3d, then select object and add scrip component in Inspector tab. Then add this script:
using UnityEngine;
using System.Collections;
public class displayOnClick : MonoBehaviour {
public GameObject displayOne = null;
private void OnMouseDown() {
print("it works");
}
}
then play the game click action not work. This script works on simple unity game object Cube etc. But not working on imported FBX object. Why? How can i implement?
please HELP and Thank you. (sorry for my english is bad)
Answer by Linus · Nov 08, 2014 at 09:09 AM
You will need to have a collider on the object. I tried your code and it worked.
I tried, it works great, thank you Linus you are the best :) happy coding!
Answer by TsomoNe · Nov 12, 2014 at 05:28 AM
I tried, it works great, thank you Linus you are the best :) happy coding!
Your answer
![](https://koobas.hobune.stream/wayback/20220613171017im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to show fbx? 0 Answers
3d max animation to Unity 1 Answer
Animation Import Question 1 Answer
FBX Import model won't change transform in playmode, only in Scenepreview. Why? 1 Answer
C4d couldn't convert to fbx file?? 2 Answers