I've been in this problem for 2 weeks now and now its pissing me off ~__~
I'm trying to destroy a game object by using mouse click, i have done it using the usual mouseclick destroy game object method. but i want the object to be destroyed when i cliked "on" it.
Raycast probably is the best for it since it's as thin as needle (lol). now i want the raycast to be at my mouse pointer so i can use it to detect collision... can someone help me with this :'(
is there a collider attatched to your object? if not, and it is imported, just use a mesh collider on it and it should work fine.
– zmar0519Is the script and the collider in the same place on the object hierarchy? If the collidor is on a child object I don't think it will trigger the script.
– anon9147783Also, make sure that it is not set to a trigger.
– zmar0519is the parent object an empty gameObject? in that case, you will need to set a var of the parent object and then tell it to destroy like this: Destroy(parentVarNameHere); .
– zmar0519