x


make an object glow when mouse over

i have import an 3d object into the scene. and i want it has a bit glow or lighter when mouse over. how can i suppose to do it.

i check some of the similar answers but related to GUI what is GUI ?

thank for answering me

more ▼

asked Apr 05 '12 at 07:45 AM

papamck gravatar image

papamck
14 3 4 4

(comments are locked)
10|3000 characters needed characters left

3 answers: sort oldest

GUI is an abbreviation of Graphical User Interface. The reason that other answers that you have found are related to GUI is that your question has direct relevance to GUI elements (in your case a button-like function).

What you are looking for is the function OnMouseOver(). Documentation can be found here. It explains how to use it, you just have to use code that accomplishes the effect that you want to have when the mouse is over the gameObject.

more ▼

answered Apr 05 '12 at 10:17 AM

PetterDK gravatar image

PetterDK
138 2 7 11

thanks for your answer and i can do the mouseover effect by using "void OnMouseEnter() { renderer.material.color = Color.red;"

but i don't want it become red i want an outline so i find out that ToonShading.unityPackage can create a white outline of an object is there any way to use Toon by script?

PetterDK thank you for answering my questions so briefly.

Apr 05 '12 at 11:11 AM papamck
(comments are locked)
10|3000 characters needed characters left

thanks for your answer and i can do the mouseover effect by using "void OnMouseEnter() { renderer.material.color = Color.red;"

but i don't want it become red i want an outline so i find out that ToonShading.unityPackage can create a white outline of an object is there any way to use Toon by script?

PetterDK thank you for answering my questions so briefly.

more ▼

answered Apr 05 '12 at 12:38 PM

papamck gravatar image

papamck
14 3 4 4

And please, do not write comments as answers.. You have already posted that exact same message as a comment.

Apr 05 '12 at 01:09 PM PetterDK
(comments are locked)
10|3000 characters needed characters left

My link was only for documentation so that you can see how it works. You will of course have to replace "renderer.material.color = Color.red;" with the effect that you want to have happen.

Unfortunately I can't help you with how to turn a shader on/off like that, but off the top of my head you might have to use a replacement shader. You can find documentation on that here: http://unity3d.com/support/documentation/Components/SL-ShaderReplacement.html.

No problem, just remember to upvote answers that you like and mark an answer as accepted..

more ▼

answered Apr 05 '12 at 01:08 PM

PetterDK gravatar image

PetterDK
138 2 7 11

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x982
x84
x55
x28

asked: Apr 05 '12 at 07:45 AM

Seen: 3003 times

Last Updated: Apr 05 '12 at 01:09 PM