Animated weapon parts

Vlaxep

Active member
Hi,

When firing a weapon eg. Pistol, is there a simple way to apply animation to parts of the weapon for each firing action?

ie. simply a cocking handle or slide assembly moving backward/forward for each shot?

Either by adjusting animation clips or some other method I can't think of?

Cheers
 
PS Also wondering if I can add slight rotations to the right hand holding the weapon for a touch of realism? Is that easy to do in the animation clip, or can it be better achieved another way?
 
All of the weapons are animated using the Animator so you'll need new animations built for your weapon's rig.
 
All of the weapons are animated using the Animator so you'll need new animations built for your weapon's rig.
Justin I think I can relatively easily perform a hack of animating this myself without entering animator territory by picking up the 'use' being triggered, but I'm wondering how to achieve this across the network with PUN add-on?

All I need to know is what/where can I get a triggered event or 'use' or 'fire' or something like that on a remote player's characterPrefab when he fires a bullet? So that I can run my 'hack' animation on the weapon itself locally from there? Thanks
 
I'm not sure but the animator is synced across the network. The use ability is also synced so you may be able to use that. I wouldn't hack it though and do it properly because it'll lead to less problems in the future.
 
Thanks Justin. All I'm talking about is a completely independent listener that will simply apply a quick rotation or position snap upon hearing the event.

ie I normally do this kind of thing simply by adding in a harmless trigger inside the C# script that tells a Bolt visual scripting machine to perform the operation. Then I use either Fungus visual scripting or Bolt VS for very easy to do physics/animation.

This removes the need to use animator, which I don't really want to mess around with if I don't have to.

I think piggybacking the use ability should work well.

Can you clarify something else Justin please - if the 'use' ability is synced, does this then perform the following locally from that command:

MuzzleFlash /Tracer / Smoke etc.?

Thanks
 
SOLVED
FYI anyone interested I managed to get something working quite decently.

Could be done with a script of course however I use Bolt visual scripting:

- In the ShootableWeapon script, I created a Bolt Custom Trigger
- On the weapon itself (1 each for 3rd person/1st person) a Bolt Flow machine 'listens' for the use trigger on the
object that the corresponding 'ShootableWeapon' component is attached to
- This machine/script then performs the physical changes desired
- (I personally use Fungus visual scripting for this part as it's easy peazy!)
 
Top