- Home /
GameObject once walked on, gives message using C#?
Hi guys,
I'm struggling to figure this code out by myself. I'm able to check if the objects are in the scene, and if they are print a message. I now want the GameObject of tag Zone to display a message to let me know when I've walked on it or at very least, touched it.
Am I entirely wrong with trying to do this with Raycast, or would I be better off trying to figure out how to do this with purely Collisions or something? Just looking for advice more than anything, I really want to figure this out as best I can.
Answer by Nivalan · Jun 15, 2014 at 03:59 AM
How I would do it is create a cube and remove the mesh render making it an invisible cube and then check the IsTrigger box. Then in the script I'd use OnTriggerEnter() class (in c# it'd be void OnTriggerEnter(){}) to display a GUIText if that's what you want.