Friday, 10 March 2017

Weapon Switching StateMachine, AnimNotify

To enable the switching of weapons, the StateMachine required some aditional nodes, to allow transition between Sword and Shield and the Broadsword.


This transition is allowed when the player presses the weapon switch control, which passes a Boolean variable into the StateMachine, telling it to begin playing the sequence.


Contained in the animations are little markers which need to be set up to communicate when to perform certain actions or events. Here these are telling the Blueprint when to hide and show the weapon meshes.


These markers are recognised when you set up events to capture these notifications. In this case we are telling the character Blueprint to run a custom event.


And here are the events, each one is setting a weapon mesh to visible or invisible based on which animations are being played.


Anim notifys are extremely useful, and I will be using them to a great extent through this project. As you can see from my StateMachine I am using it to control a lot of things on my character.

Booleans are an extremely useful variable, it is a simple 1 or 0, true/false, yes/no variable which can be used to check the state of anything you require.

No comments:

Post a Comment