Unity 5.3 - need help with raycast interaction.

Hey.
Well i have problem with scripting .
I’m making adventure game and there’s scene where you looking at cube , and i need to make script who makes a interaction when i look at this cube .
When i look at the cube i want to see effect on camera where you have shaded edges of screen and starting to hear some sound effect . with particles and sound effects , it’s not big deal , but i don’t have idea how to make script like this.

Can somebody help?
thank you.

(sorry for weak grammar)

one quick way to test:
Add fullscreen UI image (with png image for that shaded screen edges, transparent from the center) and disable the gameobject, then attach sound effect and particle emitter to some gameobject… disable this gameobject also.
Then when you want to show the effect, enable both of those objects with .SetActive() and play the sound on that object…

Do you have the raycast detection already working?

1 Like

Thanks A Lot!
I Made ui image , joined and set script to turn on screen effect when i look at cube :slight_smile:
Thank you so much :slight_smile: