Is there a way to keyframe the rotation of the minigun barrel, so it can start and stop firing at specific frames, while it keeps constant rotation set by the user. I set it up as 360 degrees rotation from frame 1 to 20, enabled cyclic modifier, but I want to make it start firing from frame 50 to 200, then 250 to 300 for example. Now it fires the whole timeframe. Maybe with driver?
Short of simply animating the barrel anytime you need it to fire (which is the simplest solution but involves a bit of fiddling in the graph editor), you could make a simulation for it.
This would let you do as you ask : set up a constant rotation speed, and then toggle it on or off at specific times. Is that what you want ?
I’d just key frame the rotation. It’s not that hard to do and you could probably learn something about animation in the process… It can all be done in the Dopesheet editor, but having a Graph editor open at the same time will enable you to see what is really happening.
Insert a key frame for rotation on frame 1. In the Dopesheet, Shift-D to duplicate the keys and move them to frame 50. On frame 70, rotate the gun barrel 360 degrees and insert a key frame. Now, from the Dopesheet’s Channel menu - Extrapolation Mode → Linear Extrapolation. Watch the Graph editor as you do this and see the changes. These keys will cause the barrel to start spinning on frame 50 and spin on forever, 360 degrees every 20 frames.
To stop the barrel from spinning, on frame 200 insert a key frame. Duplicate that key and move it to frame 201. If you playback the animation now, you’ll notice the barrel slowly spins up to speed and also slows rotation at the end. If you want it to be ‘snappier’ - Dopesheet menu Key → Interpolation Mode → Linear.
To start the barrel spinning again, duplicate the key on frame 201 and move it to frame 250. On frame 270, rotate the gun barrel 360 degrees and insert a key frame. And so on…
One question please-is there a way to make the transition between the stop and start and vice versa smoother? Now is like hard start and hard stop. I mean to gradually start spinning and then stopping.
It is possible, but it wasn’t part of the pitch. If you need an ease-in and ease-out it might make more sense to use set instance transform. Although it should still be possible using rotate instances, you would have to keep track of the last state of the rotate property and the number of frames elapsed since the state was last changed. With set instance transform, although the basic setup gets a little more complicated, adding the ease-in/out on top is more straightforward.
(I wonder if perhaps my sleep deprivation isn’t making me hallucinate about this problem…)