Issue with flashlight animation

mancu37

New member
Hi Justin / Andrew,

I set a flashlight in my character and I set in the inventory as default but for some reason when I start the scene the flashlight aim animation repeats again and again until I click on left button on the mouse, after that it seems to be working as expeted. do you know why this is happening? am I missing set something.

I've created a video with the issue, see link below


Thanks in advance,
Martin
 
Hi there! I had a similar issue a while ago.
If I remember correctly, you have to check that you assigned the flashlight item its profile at the bottom of the New Item menu.
Let me know if that works!
 
Looks like an animation thing - are you using a custom/edited animator controller at all? If so check the transitions for the flashlight's use.
 
Hi Andrew,

No, I'm using demo controller, but I'll remove the opsive folder and I'll import it again. Just one thing, I don't have the UCC as a simple package, I have it in 2 packages (TPC and FPC), I don't think it should be an issue right?.

I'll keep you posted.

Thanks,
Martin
 
I don't believe that should be an issue at all. But yeah if you are able to repro this in the demo scene or a fresh project do let us know.
 
Have you tried the suggestions from this thread so far? And are you able to repro this in the demo?
 
I did. I tried assigning the flashlight profile. Haven't tried the animation suggestion, but some direction on where that is found would be super helpful. Here is a video of it happening in the demo scene. All I did was add the flashlight to the player. In this instance it happens in the third person body. My scene happens in first person. Order of inventory items doesn't change anything, it still happens. It only stops when the flashlight is clicked on

Edit:
-Happens in HDRP and Standard Pipelines
-Also happens in new project
-Unity 2020.3.11f1
 
Last edited:
I was able to reproduce this in the demo scene too, thanks for the clarification. It seems to be an issue with the Flashlight not returning the correct value for GetItemSubstateIndex, for some reason. A quick fix for now would be to add the following line somewhere at the top of Flashlight.cs (within the Flashlight class):

C#:
public override int GetItemSubstateIndex() { return 2; }

But this might actually be the best solution longterm. I'll pass this on to Justin.
 
Top