# How to toggle/highlight interactable items?

in many games the items you want to pick change form when you are near or you are aiming at them. Sometimes they change color to a translucent green, sometimes they shine more than the rest objects in the world. I want to create this effect in BGE.

I am working with this buddha statue from GiovanniLucca: statue

In this image:

you can see what I mean if you notice the desert eagle. There is a yellow highlight.

So how can I achieve this in the statue I am working with? Should I replace its mesh with another one with a different material (highlighted material)? Should I duplicate its mesh and scale it a bit to be close to the original and then change the color of the outer mesh and animate it to change from let's say transparent to green translucent when I am aiming at it? Is there another way? Has anyone done it?

I just want the player to know with which items he can interact and with whom he can't. I tried replacing meshes with transparent materials(in the whole object) and I was disappointed with the result.

Edit: I wasn't quite clear cause I did not know the way to do this I guess. My question is, how can I re-create the effect that you see in the image around the gun(desert eagle)? When the character is near I want it to get highlighted like this. The logic-bricks-code are done to detect when the character is near. So, how can I make it emit this (yellow) light close to its faces only and keep its textures still visible?

• Could you not ask the questions here and also on BA? at least not at the same time. blenderartists.org/forum/… Aug 18 '15 at 2:52
• You should nothing. You choose the effect you want and look how you can implement it. If you have several options (you already discovered some) pick one.This is no question we can answer for you. It is your game = your design decisions. Please rephrase your question to specify what exactly you want to know (one topic please). Aug 18 '15 at 5:33
• @RadishoftheOpera making the same post in two different forums that are not run by the same people, does not only help me to get a faster answer but it also helps the people that do not search both forums but only 1 of them. Also one of the mods said he would like to make this community the 1st place where someone will look and find answers to his questions. How will that person find answers if there are no posts. They are 2 different forums with different rules about the same software. Is there a rule against posting to both?
– Lev
Aug 18 '15 at 12:11
• @Monster edited it. Had an answer already to blenderartists forum so I am gonna try to adjust it to my game and post an answer. Post if you have a different way to re-create this effect.
– Lev
Aug 18 '15 at 12:14
• @Lev a more appropriate way is to mention at the very beginning, that you're cross posting the question on BA and BSE, and that people should read the responses (if any) on the other website before answering (in case you already got answers along those lines) --that way, if someone answers without checking the other page... it's their own fault if they duplicate information :) Aug 18 '15 at 12:43

Duplicate Mesh Outline

Have a mesh to be outlined:

• shift+d to get a copy of the object and the mesh (give it appropriate names)
• ut: Make Single User "Materials + Tex", to get separate materials (give them appropriate names)
• tab enter edit mode
• select all vertices
• alt+s fatten the mesh e.g by 0.1. The resulting mesh should be larger than the original.
• w + flip normals to make the faces show inside
• tab to leave edit mode

As the outline should have an "aura" effect, I suggest to chose a shadeless material with "Add" Alpha. The color should be pretty dark. Otherwise it will hide the background too much.

This results in a semi-transparent "glowing" effect.

While it looks strange in the preview the game engine will show you a nice outline.

PS: Thanks to Satish Goda (youtube) I know now how to enable backface culling. Therfore I suggest following additional settings:

• parent the hover to the original object
• make the hover unselectable
• in Properties enable Shading/Backface Culling

This is the effect. Now you can think about logic that switches it on and off.

Hint: you can even fade it by playing material actions.

I hope it helps

• amazing! Thanks. I alt+S for a value of 0.01 though, else the deformation was huge! And I am gonna try non-shadeless materials cause the effect is a little soft.
– Lev
Aug 19 '15 at 10:25
• Also for the record, parenting as monster said and playing with visibility actuators works perfectly and it is simple.
– Lev
Aug 19 '15 at 11:21