How do i control separately the current fire mode dial of a rifle?

Hello, i have a rifle weapon that has a physical dial that specifies the current fire mode ([something like this][1]) and i want to know the best way to keep it selected while playing other animations. I’ve though about some approaches for this:

  • Have separate animations for each dial position, not an option for many reasons
  • Make the dial a separated mesh that i attach and control the rotation by code
  • Allow some kind of hierarchy while playing the animations that filters out the bone for the dial, so it stays on it’s last position, that is set by the dial change animation (which will be the only animation that wouldn’t have the filter).

Update:

I’m trying to do the third option by having 2 animmontages, one for the dial animations (on the Dial Slot, 3 sections, single, burst, automatic) and one for the fire animation (on Default Slot) just as a test. In the animgraph i tried this:

The first layered blend per bone receives the base with the Dial Slot, so i set the Branch filter to the Dial bone. Then i cache that and apply it with the Default Slot on the second Layered blend per bone, where i set that to the rest of the bones. This is not working. If i replace the base + DialSlot for a State Machine then it works, but i want it to blend so i can pass from Single to Automatic and not have 9 animations total for that, not to mention the complexity of the state machine for every combination.

Though probably not the best way, I would probably do the second option, simply because it’d be much easier and take a lot less time to do.

The best way i can think of doing this is to have a bone where the dial is and weight all the dial’s vertices to that bone and rotate the bone when you switch fire mode.

This is better than the other two ways because:

  • You won’t constantly have the animation playing which could be a performance issue
  • You don’t need to create extra animations for each weapon taking up space and clogging your content browser
  • You don’t need to import multiple meshes for each weapon again taking up space and clogging your content browser

Thank you for your answer :slight_smile: How could i play an animation on every bone except the dial bone? Layer per bone node on the animation graph? Right now the the only way to rotate a bone in realtime is also on the animation graph, right? Sorry for the questions, but my knowledge in animation blueprint is a bit limited.

I don’t know much about the animation side of things and i don’t use blueprints a lot i only use c++ so i can’t help you much but i imagine there is a way to move and rotate bones without creating assets before hand. have a look at the blueprint reference there may be a node to do it.

Otherwise you can create an animation that only rotates that one bone

I still don’t know how to make this to work, so why mark as answered KitatusStudios ?

What is it you are having trouble with exactly?

It’s creating the animation graph to make it work separately, check my update :slight_smile:

Sorry i cant help you on that front im afraid. I’m a programmer not an animator. But from what i know and can see it seems like your taking a long approach to simply implement a switch on a gun

I’m just trying to do it all with the same model if possible, if it’s not possible or it gives too much trouble for what it is then i’ll do the second approach, where the dial is a mesh on the side that is attached to the weapon.

Bit late to the party, but you could use a Skeletal Control in your AnimBlueprint to just rotate/animate the bone that the dial is skinned to. You would use a Transform (Modify) Bone control. Documentation here: LINK

Hope that helps.