- Home /
magic glow?
im realy new to unity and im busy with creating a FPS. i have an idea inspired by amnesia. what i want is to be able to pick up objects like in amnesia and move them around. only differenc is that i have a hand in the corner that i want to glow a colored light when i hold something and stop when i release my mouse button(also the object will fall down again) i tried to use a flashlight but that didn't give the effect i wanted.. so can anybody help me write a script for it.
also i work with cinema 4d and i think about making 2 textures one normal and one that glows and if i press my mouse button it switches to the one that glows and if i release it it turns back to normal.
i hope that was enough info.
Answer by bradmarxmoosepi · Dec 15, 2011 at 05:25 AM
If you are looking for a magical light effect, why not try using particle effects?
For instance, you could have a prefab that is a light and a particle emitter, and instantiate one when you pick up an object.
so like you would do llike a flashlight. i get it that's a pretty good idea i will try it!
Answer by artsdcs · Dec 15, 2011 at 12:49 PM
oke i tried it and i stumbled upon this script
function Update() {
if (Input.GetKeyDown("f")) {
if (light.enabled == true)
light.enabled = false;
else
light.enabled = true;
}
}
but how do i make it so it begins when i press my mouse button and stops when releasing it and how can i make that script so that i can do the same with particle effects?
a quicker way: if(Input.Get$$anonymous$$eyDown("f")) light.enabled = !light.enabled
don't miss the ! mark
Your answer
![](https://koobas.hobune.stream/wayback/20220613062042im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
magical glowing blue globe 3 Answers
Player Controller Rotation Script Help 2 Answers
Enemy killing help 1 Answer
Spawn Script Not Working 1 Answer