Animations Wont Play, Must be marked as legacy?

Hi Everyone,

Im fairly new to unity but have a fair knowledge of programming.

I have made an animation with mechanim using a flashlight model that is a fbx file. It contains a spotlight which I use code to toggle it on and off with some code. I have a default animation that doesnt animate anything but is linked to and animation on a condition that a bool is false.

I want to be able to press “f” the toggle button in the code to turn the bool false or true, so from there it should play the animation ? Ive tried everything but it says the animation needs to be marked as legacy or something ?

I’m so confused any help will be appreciated!

[18639-screen+shot+2013-11-28+at+1.35.03+pm.png|18639]

[18640-screen+shot+2013-11-28+at+1.37.06+pm.png|18640]

assuming I'm understanding things correctly here, tanoshimi is saying anyone who wants to make a light pulse like this, should put the script he linked to on that light, and edit the line that says: transform.localScale.y = volume * rmsValue; to instead say: transform.GetComponent.<Light>().intensity = volume * rmsValue; you might also have to add a multiplier of some sort or clamp the value in some range to get the right effect, which you can add to the end of that line.

1 Answer

1

Solved*

Turns out I was using the animator controller on the “spotlight” game object instead of the actual “flash light” game object.

Ahh okay. What about an object's emission brightness? This works perfectly as a back up if I can't get an objects brightness to change so thanks!

I tried it but couldn't get it to work. Maybe I'm not doing it right. I am a newbie to this after all. I've found the scale and light intensity to look nice and is probably more visible in it's change.