- Home /
[SOLVED] Raycast for custom button JS
Hey, guys!
I'm trying to create custom buttons with a PSD (can be made any other format if necessary) image, and I have a hover, pressed, and regular image. How could I get this to work as buttons in a 2D environment?
I've looked at Raycast, but I don't really understand it nor can I figure out how to code it for buttons.
Does anyone have some example code, if they would be able to supply it?
Thanks for the help in advance!
Answer by Eric5h5 · Sep 27, 2014 at 03:33 AM
You don't need any raycasting, just use the GUI system. Either GUI.Button, or else use the new UI button object in Unity 4.6.
Thanks...FYI, the correct way to accept answers is to click on the checkmark, not write "solved" in the title.
Your answer
Follow this Question
Related Questions
Change raycasting 1 Answer
Raycasting ignoring small sized object 1 Answer
Problem with raycasting when checking neighbouring objects? 0 Answers
Upper limits of Raycasting; Physics engine "gives up" 0 Answers
Checking if object stopped being hit by Raycast while overlapping another object of the same type. 0 Answers