Creating a blank item for holstering

Hamesh

Member
I would like to create a custom default item which will not have any attacks so to speak. It would be similar to the body item except it won't have any animations at all. Instead when the aim or fire/attack input is pressed I would like the item to trigger a switch to the next item and aim or fire/attack based on what the input was. This is common in games where the melee/body attacks are bound to a separate button to the aim and trigger buttons, and as such when a weapon is holstered it would not make logical sense for the aim or trigger to have the character start punching but rather unholster their weapon and use it.

How would I go about setting this up? I would imagine I could probably create a second version of the body item but change the animator properties so that it wouldn't play any animations. I couldn't find any events for aim and use though, which would be ideal for executing the custom code for item switching and aiming/using. Or would I need to add this custom code somewhere else?
 
Creating a new item with the None ItemAction sounds like it would work. Instead of using animation events you can use the timer.
 
That does make sense, but are you able to point me to where the item action is located, I have looked through the item and cannot find it. Also, by new item do you mean a custome item types needs to be created or can the existing melee item be used? If I use a timer where should I place the custom code so that it is executed when the aim or fire buttons are pressed?
 
Reading it again I don't recommend creating a new item with the None ItemAction option selected. Instead you should subscribe to the OnItemAbilityActive events to then start a new ability, such as switching the item.
 
Top